您当前的位置: 首页 > 

暂无认证

  • 0浏览

    0关注

    92582博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

vue+this.$set+Vue.set的使用

发布时间:2021-12-08 22:30:44 ,浏览量:0

目录
  • 1、html代码
  • 2、JavaScript代码
  • 3、完成代码
  • 4、相关链接
1、html代码
<el-row> <el-col> <span>1:{objectValue.value}}{objectArrayValue.value[0]}}{objectArrayObjectValue.value[0].value}}{arrayValue[0]}}{arrayObjectValue[0].value}}{arrayObjectArrayValue[0].value[0]}} if (type == 1) { this.value = type; // 更新成功 // this.$set(this, 'value', type); // 更新成功 // Vue.set(this, 'value', type); // 更新成功 } else if (type == 2) { this.objectValue.value = 2; // 更新成功 // this.$set(this.objectValue, 'value', type); // 更新成功 // Vue.set(this.objectValue, 'value', type); // 更新成功 } else if (type == 3) { // this.objectArrayValue.value[0] = type; // 更新失败 this.$set(this.objectArrayValue.value, 0, type); // 更新成功 // Vue.set(this.objectArrayValue.value, 0, type); // 更新成功 } else if (type == 4) { this.objectArrayObjectValue.value[0].value = type; // 更新成功 // this.$set(this.objectArrayObjectValue.value[0], 'value', type); // 更新成功 // Vue.set(this.objectArrayObjectValue.value[0], 'value', type); // 更新成功 } else if (type == 5) { // this.arrayValue[0] = type; // 更新失败 this.$set(this.arrayValue, 0, type); // 更新成功 // Vue.set(this.arrayValue, 0, type); // 更新成功 } else if (type == 6) { this.arrayObjectValue[0].value = type; // 更新成功 // this.$set(this.arrayObjectValue[0], 'value', type); // 更新成功 // Vue.set(this.arrayObjectValue[0], 'value', type); // 更新成功 } else if (type == 7) { // this.arrayObjectArrayValue[0].value[0] = type; // 更新失败 // this.$set(this.arrayObjectArrayValue[0].value, 0, type); // 更新成功 Vue.set(this.arrayObjectArrayValue[0].value, 0, type); // 更新成功 } } 
3、完成代码

gitee(码云) - mj01分支 - vue_set 文件夹

4、相关链接

CSDN-vue中的$set和Vue.set方法

关注
打赏
1653961664
查看更多评论
立即登录/注册

微信扫码登录

0.4613s