vue 用typescript 写computed里的方法不生效?

vue 用typescript 写computed里的方法不生效?应该怎么写?
变量是这么声明的
private activeIndex:number=0;

` top():string {

console.log('5555');
return - this.activeIndex * 35 + 'px';

}`

阅读 9.7k
1 个回答
export default class App extends Vue {
    //...
    
    get name () {
        //computed name
        return 'hey ' + this.msg
    }

}
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进