规格列表,编辑不回显问题
parent
39f7f1ed38
commit
d1a974f6b0
|
@ -29,7 +29,7 @@
|
||||||
<FormItem label="规格值" prop="specValue">
|
<FormItem label="规格值" prop="specValue">
|
||||||
<Select v-model="form.specValue" placeholder="输入后回车添加" multiple filterable allow-create
|
<Select v-model="form.specValue" placeholder="输入后回车添加" multiple filterable allow-create
|
||||||
:popper-append-to-body="false" popper-class="spec-values-popper"
|
:popper-append-to-body="false" popper-class="spec-values-popper"
|
||||||
style="width: 100%; text-align: left; margin-right: 10px">
|
style="width: 100%; text-align: left; margin-right: 10px" @on-create="handleCreate2">
|
||||||
<Option v-for="item in specValue" :value="item" :label="item" :key="item">
|
<Option v-for="item in specValue" :value="item" :label="item" :key="item">
|
||||||
</Option>
|
</Option>
|
||||||
</Select>
|
</Select>
|
||||||
|
@ -149,6 +149,9 @@ export default {
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
handleCreate2 (v) {
|
||||||
|
console.log(v);
|
||||||
|
},
|
||||||
//初始化,获取数据
|
//初始化,获取数据
|
||||||
init () {
|
init () {
|
||||||
this.getDataList();
|
this.getDataList();
|
||||||
|
@ -255,7 +258,6 @@ export default {
|
||||||
},
|
},
|
||||||
//弹出编辑框
|
//弹出编辑框
|
||||||
edit (v) {
|
edit (v) {
|
||||||
console.log(v);
|
|
||||||
this.modalType = 1;
|
this.modalType = 1;
|
||||||
this.modalTitle = "编辑";
|
this.modalTitle = "编辑";
|
||||||
// 转换null为""
|
// 转换null为""
|
||||||
|
@ -265,19 +267,17 @@ export default {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
let localVal = v.specValue;
|
let localVal = v.specValue;
|
||||||
console.log(localVal.split(","))
|
|
||||||
this.form.specName = v.specName;
|
this.form.specName = v.specName;
|
||||||
this.form.id = v.id;
|
this.form.id = v.id;
|
||||||
this.$nextTick(() => {
|
// this.$nextTick(() => {
|
||||||
this.$set(this.form, 'specValue', localVal.split(","))
|
// this.$set(this.form, 'specValue', localVal.split(","))
|
||||||
})
|
// })
|
||||||
|
this.form.specValue = localVal.split(",")
|
||||||
if (localVal && localVal.indexOf("," > 0)) {
|
if (localVal && localVal.indexOf("," > 0)) {
|
||||||
this.specValue = this.form.specValue;
|
this.specValue = this.form.specValue;
|
||||||
} else {
|
} else {
|
||||||
this.specValue = [];
|
this.specValue = [];
|
||||||
}
|
}
|
||||||
console.log("form.specValue", this.form);
|
|
||||||
this.modalVisible = true;
|
this.modalVisible = true;
|
||||||
},
|
},
|
||||||
// 删除规格
|
// 删除规格
|
||||||
|
|
Loading…
Reference in New Issue