当前位置: 移动技术网 > IT编程>脚本编程>vue.js > vue forEach循环数组拿到自己想要的数据方法

vue forEach循环数组拿到自己想要的数据方法

2018年10月07日  | 移动技术网IT编程  | 我要评论

老板伪装新人视察,w910i游戏,sf175战歌网

如下所示:

 <el-checkbox v-for="(item) in jurisdictioncontent"
      :label="item.id"
      :key="item.id"
      class="checkboxmargin">
   <span>{{item.value}}{{item.checked}}</span>
   </el-checkbox>
 handlejurisdiction(index, row) {//获取权限
  this.selectedcheck=[];
  let me = this;
  this.jurisdiction = true;
  this.roleid = row.id;
  this.$http.get("/role/resources", {
   params: {roleid: this.roleid}
   },
   {
   emulatejson: true
   }).then((response) => {
   me.jurisdictioncontent = response.body;
   me.jurisdictioncontent.foreach(function (c) {
   if(c['checked']){
    me.selectedcheck.push(c.id);
   }
   })
   console.log(this.selectedcheck)
  })

vue 中标签里循环使用v-for,方法里面循环使用foreach。

以上这篇vue foreach循环数组拿到自己想要的数据方法就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持移动技术网。

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网