小白灿灿子 2021-06-02 17:05 采纳率: 72%
浏览 34
已结题

vue的v-forkey的问题

 <!-- 内容表单 -->

    <div v-show="printShow" class="print print_container">

      <div class="print_content">

        <div>

          <span class="print_span">* </span>

          <span class="print_title">打印模板名称:</span>

          <el-input

            v-model="printObject.printName"

            type="text"

            style="width: 30%"

          ></el-input>

         

        </div>

        <div>

          <span class="print_span">* </span

          ><span class="print_title"> 允许发送邮件: </span>

          <el-radio v-model="printObject.allowSendEmail" :label="true">

            是

          </el-radio>

          <el-radio v-model="printObject.allowSendEmail" :label="false">

            否

          </el-radio>

         

        </div>

        <div>

          <span class="print_span">* </span

          ><span class="print_title"> 附件格式: </span>

          <el-select v-model="printObject.attachmentFormat">

            <el-option

              v-for="(data, index) in formatList"

              :key="index"

               :value="data.keyId"

               :label="data.title"

            />

          </el-select>

         

        </div>

        <div>

          <span class="print_span">* </span>

          <span class="print_title"> 文件名称: </span>

          <el-select v-model="printObject.fileNameWay">

            <el-option

              v-for="(data, index) in filetList"

              :key="index"

              :lable="data.title"

              :value="data.title"

            />

          </el-select>

        

        </div>

        <div>

          <span class="print_span">* </span>

          <span class="print_title"> 转档是否合并: </span>

          <el-radio v-model="printObject.fileMerge" :label="true">是</el-radio>

          <el-radio v-model="printObject.fileMerge" :label="false">否</el-radio>

          {{ printObject.fileMerge }}

        </div>

        <!--  <el-divider></el-divider> -->

      </div>

    </div>

    <!-- 内容打印表格 -->

    <div class="print" v-show="!printShow">

      <!--  -->

      <el-row style="height: 100%">

        <el-col :span="5" style="height: 100%"

          ><!-- style=" height:100%; " -->

          <draggable

            class="dragArea dragArea-empty"

            @end="logTab"

            :group="{ name: 'form-design' }"

            :list="datasource.controlCustoms"

            id="components1"

            :options="{ draggable: '.item-drag' }"

          >

            <template v-if="datasource != null">

              <div class="maintable">

                <i class="el-icon-folder"></i>{{ datasource.title }}

              </div>

              <template v-for="(item, index) in datasource.controlCustoms">

                <div

                  v-if="item.controlType != 10 && item.controlType != 11"

                  class="mainField item-drag"

                  :key="index"

                  fieldtype="field"

                  :table="datasource.title"

                  :fieldName="datasource.title + '.' + item.title"

                >

                  <i class="el-icon-tickets"></i>

                  {{ item.title }}

                </div>

 

                <template v-if="item.controlType == 10">

                  <div  class="subtable" >

                    <i class="el-icon-folder"></i>{{ item.title }}

                  </div>

 

                  <template

                    v-for="(datas, k) in item.controlCustoms"

                    class="filed_data"

                  >

                    <div

                      :table="item.title"

                      :key="k"

                      fieldtype="field"

                      class="subField item-drag"

                      @click="clickFiled(item, datas)"

                      :fieldName="item.title + '.' + datas.title"

                    >

                      <i class="el-icon-tickets"></i>

                      {{ datas.title }}

                    </div>

                  </template>

 

                  <template v-if="datas.controlType == 11">

                    <div

                      v-for="(it1, kk) in datas.expansionAttribute.RelationFields"

                      :key="kk"

                      :table="item.title"

                      :move="onMove"

                      fieldtype="vfield"

                      class="subField item-drag"

                      :fieldName="

                        item.title + '.' + datas.title + '.' + it1.fieldTitle

                      "

                    >

                      <i class="el-icon-tickets"></i>

                      {{ datas.title + "." + it1.fieldTitle }}

                    </div>

                  </template>

                </template>

          

                <div

                  :key="index"

                  v-if="item.controlType == 11"

                  fieldtype="field"

                  class="subField item-drag"

                  :table="datasource.title"

                  :fieldName="item.title"

                >

                  <i class="el-icon-tickets"></i>

 

                  {{ item.title }}

                </div>

 

                <template v-if="item.controlType == 11">

                  <template

                    v-for="(it2, iii) in item.expansionAttribute.RelationFields"

                    class="filed_data"

                  >

                    <div

                      :key="iii"

                      fieldtype="vfield"

                      class="subVField item-drag"

                      :table="datasource.title"

                      :fieldName="

                        datasource.title +

                        '.' +

                        item.title +

                        '.' +

                        it2.fieldTitle

                      "

                    >

                      <i class="el-icon-tickets"></i>

                      {{ it2.fieldTitle }}

                    </div>

                  </template>

                </template>

              </template>

            </template>

          </draggable>

        </el-col>

        <el-col :span="19" style="height: 100%; min-height: 400px">

          <draggable class="print_model">

            <div

              id="printbyModel"

              ref="printbyModelDiv"

              style="height: 100%"

            ></div>

          </draggable>

        </el-col>

      </el-row>

    </div>

  • 写回答

2条回答 默认 最新

  • 崽崽的谷雨 2021-06-02 17:08
    关注

    说明你的key不是唯一值,有重复的。一般都是数据中的id或者index

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

问题事件

  • 系统已结题 9月14日
  • 已采纳回答 9月6日

悬赏问题

  • ¥15 设计数字电路得到要求结果
  • ¥15 hfss 组天线阵列报错:The A and B vectors must be parallel to the XY plane,如何解决?
  • ¥30 ansible连接设备报错
  • ¥60 pmsampsize包取值问题
  • ¥15 波形合成电路的设计学习
  • ¥15 unity脚本挂不上
  • ¥15 数学建模数学建模需要
  • ¥20 Java Sound Api 调用Mixer.getLine偶现Line unsupported错误。
  • ¥15 使用cuda加速opencv运算但是报错AttributeError: module 'cv2.cuda' has no attribute 'getCudaEnabledDeviceCount'
  • ¥15 java输入输出异常