template props intellisense respect to jsdoc type
See original GitHub issueInfo
- Platform: win7 x64
- Vetur version: 0.21.0
- VS Code version: 1.35.1
Problem
Props intelliSense has been provided to template interpolation since #1083 , however for Object
type seems not enough, is that possible to provide intelliSence type base on jsDoc @type
? For the code in image, when I type .
after sum
, there’s no intelliSence at all, I shall expect to select from v1
and v2
.
Reproducible Case
Create a Vue component with following code
// Test.vue
<template>
<div class="container">
<p v-if="loading">loading...{{sum}}</p>
<h1 v-if="!loading">
<p>{{sum.v1}}</p> <!-- <--- here after sum I shall have intelliSense -->
<p>{{sum.v2}}</p>
</h1>
</div>
</template>
<script>
export default {
name: 'Test',
props: {
loading: {
type: Boolean,
required: true
},
/** @type {{v1: number, v2: number}} */
sum: {
type: Object,
required: true
}
},
data() {
return {
message: 'Using Parcel In A Vue.js App',
};
},
};
</script>
Issue Analytics
- State:
- Created 4 years ago
- Reactions:3
- Comments:12 (4 by maintainers)
Top Results From Across the Web
Using JSDoc to enable intellisense for render props in vscode
Setup. We have a react codebase where we have many React components with the render props pattern. In this codebase we haven't enabled ......
Read more >How to use JsDoc annotations with VsCode for intellisense
Here, we are using @typedef to define custom type definations, in this case type Moment which is provided in the "moment" library and...
Read more >Documenting components - Vue Styleguidist
Vue styleguidist will display the contents of your components' JSDoc ... You can use the following tags when documenting components, props and methods....
Read more >Two ways you can take advantage of types in JavaScript ...
Here's an example of declaring a variable and assigning it a value. The intellisense is coherent with the type of that value:.
Read more >how to document this keyword in custom components with ...
The this keyword in Vue framework is an object of type Vue . You can identify it by debugging your code within your...
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
You can declare your props’ types like this:
I don’t know if it’s the recommended way, but it will enable IntelliSense with your object’s properties.
If you use typescript:
javascript: