Skip to content

Commit

Permalink
多列输入改为以换行符隔开
Browse files Browse the repository at this point in the history
  • Loading branch information
zhh committed May 24, 2018
1 parent a0c8a11 commit 6c01794
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/views/pms/productAttr/components/ProductAttrDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
</el-radio-group>
</el-form-item>
<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 label="是否支持手动新增:">
<el-radio-group v-model="productAttr.handAddStatus">
Expand Down Expand Up @@ -100,19 +100,27 @@
{min: 2, max: 140, message: '长度在 2 到 140 个字符', trigger: 'blur'}
]
},
productAttrCateList: null
productAttrCateList: null,
inputListFormat:null
}
},
created() {
if(this.isEdit){
getProductAttr(this.$route.query.id).then(response => {
this.productAttr = response.data;
this.inputListFormat = this.productAttr.inputList.replace(/,/g,'\n');
});
}else{
this.resetProductAttr();
}
this.getCateList();
},
watch:{
inputListFormat: function (newValue, oldValue) {
newValue = newValue.replace(/\n/g,',');
this.productAttr.inputList = newValue;
}
},
methods: {
getCateList() {
let listQuery = {pageNum: 1, pageSize: 100};
Expand Down

0 comments on commit 6c01794

Please sign in to comment.