其他分享
首页 > 其他分享> > computed

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
来源: https://www.cnblogs.com/lxq3280/p/16596488.html