You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hmm, this was an oversight. For now if the property is only used in the template, you can define it in the decorator:
If the property is used in code you will have to cast 'this' like so: (<any>this).a for now just declare a variable of the same name and type (dont assign it a value, just declare it).
@VueComponent({
computed: {
a: {
cache:false,
get:function(){return 'hello'}
}
}
})
export class Component{
a:string;
ready(){
console.log(this.a) //<will get the computed function above
}
}
Ill think of a solution and reply here when i have one, this will probably require the addition of a new decorator. Putting @Copmuted({}) above the getter or setter most probably
e.g.
computed: {
in vue-typescript, how to get this feature by using decorator?
The text was updated successfully, but these errors were encountered: