求助,怎么在@Component中获取computed值
我用的是typescript
目前是如下解决的
···
@Component({
watch: {
watchTest: function () {
let _this: any = this
console.log(_this.test)
}
}
})
export default class App extends Vue {
get test (): string {
return ‘Welcome to …’
}
}
···
在 this.$data 中找不到 computed test
再请教 watch 怎么写到 class 内,不写在 @Component中