多列输入改为以换行符隔开
This commit is contained in:
parent
a0c8a118c5
commit
6c01794fa3
@ -47,7 +47,7 @@
|
|||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="属性值可选值列表:">
|
<el-form-item label="属性值可选值列表:">
|
||||||
<el-input :autosize="true" type="textarea" v-model="productAttr.inputList"></el-input>
|
<el-input :autosize="true" type="textarea" v-model="inputListFormat"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="是否支持手动新增:">
|
<el-form-item label="是否支持手动新增:">
|
||||||
<el-radio-group v-model="productAttr.handAddStatus">
|
<el-radio-group v-model="productAttr.handAddStatus">
|
||||||
@ -100,19 +100,27 @@
|
|||||||
{min: 2, max: 140, message: '长度在 2 到 140 个字符', trigger: 'blur'}
|
{min: 2, max: 140, message: '长度在 2 到 140 个字符', trigger: 'blur'}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
productAttrCateList: null
|
productAttrCateList: null,
|
||||||
|
inputListFormat:null
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
if(this.isEdit){
|
if(this.isEdit){
|
||||||
getProductAttr(this.$route.query.id).then(response => {
|
getProductAttr(this.$route.query.id).then(response => {
|
||||||
this.productAttr = response.data;
|
this.productAttr = response.data;
|
||||||
|
this.inputListFormat = this.productAttr.inputList.replace(/,/g,'\n');
|
||||||
});
|
});
|
||||||
}else{
|
}else{
|
||||||
this.resetProductAttr();
|
this.resetProductAttr();
|
||||||
}
|
}
|
||||||
this.getCateList();
|
this.getCateList();
|
||||||
},
|
},
|
||||||
|
watch:{
|
||||||
|
inputListFormat: function (newValue, oldValue) {
|
||||||
|
newValue = newValue.replace(/\n/g,',');
|
||||||
|
this.productAttr.inputList = newValue;
|
||||||
|
}
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getCateList() {
|
getCateList() {
|
||||||
let listQuery = {pageNum: 1, pageSize: 100};
|
let listQuery = {pageNum: 1, pageSize: 100};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user