Spring Cloud alibaba+Vue,開發(fā)仿社交小程序
argetObj = {
? ? ? ?id : 1,
? ? ? ?name : 'pxh',
? ? ? ?age : 20,
? ? ? ?school : '小學'
? ?}
? ?
? ?
? ?var handler = {
? ? ? ?// 定義get方法,get方法可以接收2個參數(shù),分別是原來的對象及屬性
? ? ? ?get : function(target,prop){
? ? ? ? ? ?if(prop == 'id'){
? ? ? ? ? ? ? ?return undefined;
? ? ? ? ? ?}
? ? ? ? ? ?return target[prop];
? ? ? ?},
? ? ? ?// 定義set方法,set方法比get多1個參數(shù),那就是該屬性修改時的值
? ? ? ?set : function(target,prop,value){
? ? ? ? ? ?if(prop == 'id' || prop == 'name' || prop == 'age'){
? ? ? ? ? ? ? ?console.log(`不允許修改${pro
標簽: