比如
//main.ts
Vue.prototype.currentGroup = function() {return JSON.parse(localStorage.getItem('currentUser') as any).group}();
模板文件里使用{{currentGroup}}切换页面发现它不会更新,只执行过一次。
Vue.prototype.currentGroup = function() {return JSON.parse(localStorage.getItem('currentUser') as any).group};
{{currentGroup()}}这可以,但是要多写个()。,,不想写行么。。