首页 > 其他分享 >computed

computed

时间:2022-08-17 19:23:23浏览次数:81  
标签:function return 读取 vm v2 computed

computed

参考自:https://v2.cn.vuejs.org/v2/api/#computed

computed与watch的区别:http://t.zoukankan.com/jing-tian-p-11247546.html

computed:{
    //仅读取
  double:function(){
     return this.a*2+1;
  }

  //即可读取又可设置
aPlus:{
  get:function(){
        return this.vm*2+1;
  }
   set:function(a){
      this.vm=a-1;
  }
    
  }
}

  

标签:function,return,读取,vm,v2,computed
From: https://www.cnblogs.com/lxq3280/p/16596488.html

相关文章