zoukankan      html  css  js  c++  java
  • elementUI el-form model 动态生成 ,el-input v-model 动态生成

              <template v-for="(pledgeMovables,pledgeIndex) in protocol.pledgeMovables">
                        <el-form :model="pledgeMovables.model != 'noForm' ? $data[`${pledgeMovables.model}`]:{}" label-width="0">
                            <div v-if="pledgeMovables.subtitle" class="protocol-subtitle">{{pledgeMovables.subtitle}}</div>
                            <div class="protocol-title">{{pledgeMovables.name}}</div>
                            <div class="protocol-msg">
                                <!-- 头部 -->
                                <div class="title">
                                    <template v-for="(item,index) in pledgeMovables.title">
                                        <div class="col-line" v-if="item.isLine">
                                            <p :class="[line.include ? 'txtCont-indent noneIndent':'txtLeft',line.font?'fontW':'']" v-for="line in item.lineChildren">
                                                <template v-if="line.include">
                                                    <span class="txt-span">
                                                        {{line.label}}
                                                        <template v-for="itm in line.children">
                                                            <span class="txt-span" v-if="itm.type==0">{{itm.label}}</span>
                                                            <el-form-item v-else-if="itm.type==1" :prop="itm.prop" :rules="rule">
                                                                <el-input v-model="$data[`${pledgeMovables.model}`][itm.prop]" @keyup.native="elInputResizeWidth"></el-input>
                                                            </el-form-item>
                                                            <span class="underline" v-else-if="itm.type==2">{{itm.label}}</span>
                                                            <span style="font-weight:bold" v-else-if="itm.type==3">{{itm.label}}</span>
                                                            <span style="font-weight:bold" class="underline" v-else-if="itm.type==4">{{itm.label}}</span>
                                                            <span class="noInput" v-else-if="itm.type==5"></span>
                                                        </template>
                                                    </span>
                                                </template>
                                            </p>
                                        </div>
                                    </template>
                                </div>
                            </div>
                        </el-form>
                    </template>
    

      

  • 相关阅读:
    python的虚拟环境管理
    树的转换
    表达式·表达式树·表达式求值
    找和为K的两个元素
    最大奇数与最小偶数之差的绝对值
    L1-026 I Love GPLT (5分)
    L1-025 正整数A+B (15分)
    L1-024 后天 (5分)
    L1-023 输出GPLT (20分)
    L1-022 奇偶分家 (10分)
  • 原文地址:https://www.cnblogs.com/dyy-dida/p/12133875.html
Copyright © 2011-2022 走看看