new Vue({
el: '.app',
data: {
foo: 'test',
},
computed: {
_foo: {
set: function(value) { this.foo = value; }, get: function() { return this.foo } } } })
以上DEMO 双向绑定 可以在set 于 get中增加复杂逻辑
转载于:https://www.cnblogs.com/zymsdn/p/6432180.html