求助,怎么在@Component中获取computed值

weixin_38129823 2018-05-11 04:26:59
我用的是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中
...全文
25 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
weixin_38132030 2018-05-11
  • 打赏
  • 举报
回复
GitHub kaorun343/vue-property-decorator vue-property-decorator - Vue.js and Property Decorator

433

社区成员

发帖
与我相关
我的任务
社区描述
其他技术讨论专区
其他 技术论坛(原bbs)
社区管理员
  • 其他技术讨论专区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧