小白灿灿子 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 echarts动画效果失效的问题。官网下载的例子。
  • ¥60 许可证msc licensing软件报错显示已有相同版本软件,但是下一步显示无法读取日志目录。
  • ¥15 Attention is all you need 的代码运行
  • ¥15 一个服务器已经有一个系统了如果用usb再装一个系统,原来的系统会被覆盖掉吗
  • ¥15 使用esm_msa1_t12_100M_UR50S蛋白质语言模型进行零样本预测时,终端显示出了sequence handled的进度条,但是并不出结果就自动终止回到命令提示行了是怎么回事:
  • ¥15 前置放大电路与功率放大电路相连放大倍数出现问题
  • ¥30 关于<main>标签页面跳转的问题
  • ¥80 部署运行web自动化项目
  • ¥15 腾讯云如何建立同一个项目中物模型之间的联系
  • ¥30 VMware 云桌面水印如何添加