computed 里写的是方法,而不是监听数据
在sum的dom中调用就好
computed: {
getSum : function () {
return this.user.x + this.user.y
}
}
sum的 input这么写
<input :value = "getSum()">
在sum的dom中调用就好
computed: {
getSum : function () {
return this.user.x + this.user.y
}
}
sum的 input这么写
<input :value = "getSum()">
