Browse Source

修改动态表单方法

master
maguoqiang 6 years ago
parent
commit
cdd03ecc72
  1. 11
      src/views/modules/case/typicalcase-add-or-update.vue

11
src/views/modules/case/typicalcase-add-or-update.vue

@ -30,7 +30,7 @@
<!-- 实际案例--> <!-- 实际案例-->
<div v-for="(item, index) in dataForm1.dynamicItem" :key="index"> <div v-for="(item, index) in dataForm1.dynamicItem" :key="index">
<div style="text-align: left">{{"案例"+dataForm1.number}}</div> <div style="text-align: left">{{"案例"+(index+1)}}</div>
<el-form :model="dataForm1" :rules="dataRule" ref="dataForm1" @keyup.enter.native="dataFormSubmitHandle()" :label-width="$i18n.locale === 'en-US' ? '120px' : '80px'"> <el-form :model="dataForm1" :rules="dataRule" ref="dataForm1" @keyup.enter.native="dataFormSubmitHandle()" :label-width="$i18n.locale === 'en-US' ? '120px' : '80px'">
<el-form-item label="案例来源" style="width: 40rem;"> <el-form-item label="案例来源" style="width: 40rem;">
<el-cascader v-model="ids" <el-cascader v-model="ids"
@ -55,9 +55,9 @@
</el-form> </el-form>
<!-- 发布按钮--> <!-- 发布按钮-->
<el-form> <el-form>
<template slot="footer"> <!-- <template slot="footer">-->
<el-button type="primary" @click="dataFormSubmitHandle()">{{"发布案例"}}</el-button> <el-button type="primary" @click="dataFormSubmitHandle()">{{"发布案例"}}</el-button>
</template> <!-- </template>-->
</el-form> </el-form>
</div> </div>
</el-card> </el-card>
@ -74,6 +74,7 @@ import 'quill/dist/quill.bubble.css'
export default { export default {
created () { created () {
this.addItem() this.addItem()
this.addItem()
}, },
components: { components: {
quillEditor quillEditor
@ -179,9 +180,7 @@ export default {
}, },
// //
addItem () { addItem () {
let num = this.dataForm1.number this.dataForm1.number++
num = num + 1
this.dataForm1.number = num
this.dataForm1.dynamicItem.push({ this.dataForm1.dynamicItem.push({
number: this.dataForm1.number, number: this.dataForm1.number,
ids: '', ids: '',

Loading…
Cancel
Save