templateInterpolationService does not work in Nuxt projects
See original GitHub issueInfo
- Platform: Linux
- Vetur version: 0.22.3
- VS Code version: 1.38.1
Problem
I set “vetur.experimental.templateInterpolationService” to true in my settings. Interpolation does not work on vue template inside a Nuxt projet. It however works in a standart Vue project.
Reproducible Case
npx create-nuxt-app test
and choose all default with jsconfig enabled- Replace pages/index.vue text by:
<template>
<v-layout>
<p>{{ helloWorld }}</p>
</v-layout>
</template>
<script>
export default {
name: 'Accueil',
data() {
return {
helloWorld: 'test'
}
},
head() {
return {
title: 'Accueil'
}
}
}
</script>
- Now the interpolation doesn’t work, it is probably due to custom methods used by nuxt such as
head()
.
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (3 by maintainers)
Top Results From Across the Web
Resolve "Property does not exist on type 'Vue'" error
I found this had an odd effect. Sometimes it worked, i.e. the VS Code error messages disappeared; and other times it didn't, they...
Read more >Setup | Vetur - GitHub Pages
# Project Setup · package.json must exist in the project root, Vetur uses it to determine the installed Vue version. · Next, create...
Read more >Creating Server-side Rendered Vue.js Apps Using Nuxt.js
There we go. Open your browser to localhost:3000 and your project should be running. Not much different from creating a Vue Webpack project....
Read more >Class Components with JSX in NuxtJS - Damir's Corner
There are downsides to it, though. Although JSX is officially supported in Vue.js, it won't necessarily work out-of-the-box in all frameworks ...
Read more >Really typing Vue
inb4: This is not another “setting up” a new project with Vue and ... We have this wonderful template with Nuxt , Vue...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yes, your assumption is correct. Since template interpolation service uses TypeScript type of Vue component, it needs to be properly typed. You should install
@nuxt/types
and read it injsconfig.json
.Well, then I guess there is no bug here.
Personally I do plan to switch to TS eventually but this is about JS + JSDoc annotations. 😃