Support analyzing vue-class-component
See original GitHub issueContinuing #1083
ComponentInfo
is not able to analyze vue-class-component
yet.
The source looks like below, so it needs a different AST visitor. Maybe we can use typing from vue-class-component
to analyze it.
@Component({
props: {
propMessage: String
}
})
export default class App extends Vue {
// initial data
msg = 123
// use prop values for initial data
helloMsg = 'Hello, ' + this.propMessage
// lifecycle hook
mounted () {
this.greet()
}
// computed
get computedMsg () {
return 'computed ' + this.msg
}
// method
greet () {
alert('greeting: ' + this.msg)
}
}
Issue Analytics
- State:
- Created 5 years ago
- Reactions:55
- Comments:6 (2 by maintainers)
Top Results From Across the Web
No results found
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
It is also important to note that vue-class-component is often used along with the vue-property-decorator for defining props
I’d like to limit this issue to only vue-class-component, which is officially supported.
There are many decorator libraries such as https://github.com/kaorun343/vue-property-decorator, https://github.com/itsFrank/vue-typescript, and one in the upcoming Vue 3 https://github.com/vuejs/rfcs/pull/17. Supporting them all is likely a lot of maintenance.