美文网首页
vue v-for列表、json渲染

vue v-for列表、json渲染

作者: 头脑之外 | 来源:发表于2019-07-11 18:23 被阅读0次
           <div class="top3-content" v-for="(key,dataMapName) in data"> 
              <el-row>
                <el-col :span="24" class="top">
                  <span class="left-circle-icon"></span>
                  <span>{{dataMapName}}</span>
                </el-col>
              </el-row>
              <el-row v-for="v in key">
                <div class="top-content">
                  <span class="gray-span">{{v.name}}:</span>
                  <span class="main-span">{{v.value}}</span>
                </div>
              </el-row>
            </div>
    
    methods: {
        getCurrent(){
          getCurrent().then(res => {
            let _this = this;
            const data = res.data.data; // arr
            _this.data = data.dataMap; // json
            _this.tenantCode = data.tenantCode;
            _this.systemName = data.systemName;
            _this.contactNumber = data.contactNumber;
            _this.linkman = data.linkman;
            for (var key in _this.data) {
              console.log(key + "," + _this.data[key].length);
            }
          }).catch(error => {
            this.$message.error(new Error("报错啦!"));
          });
        }
    

    相关文章

      网友评论

          本文标题:vue v-for列表、json渲染

          本文链接:https://www.haomeiwen.com/subject/mdfjkctx.html