computed的原始模式 : get 和 set
作者:互联网
// 完整的写法: fullname: { get: function() { return this.firstname + " " + this.lastname }, set: function(value) { const names = value.split(" ") this.firstname = names[0] this.lastname = names[1] } }
标签:function,set,computed,firstname,get,lastname,names 来源: https://www.cnblogs.com/qd-lbxx/p/16592529.html