|
|
@@ -20,11 +20,11 @@
|
|
|
</el-form-item>
|
|
|
<el-form-item prop="tag" label="套餐标签">
|
|
|
<el-tag
|
|
|
- :key="tag"
|
|
|
- v-for="tag in dynamicTags"
|
|
|
+ :key="i"
|
|
|
+ v-for="(tag, i) in formData.tag"
|
|
|
closable
|
|
|
:disable-transitions="false"
|
|
|
- @close="handleClose(tag)"
|
|
|
+ @close="removeTag(i)"
|
|
|
size="medium"
|
|
|
>
|
|
|
{{ tag }}
|
|
|
@@ -81,7 +81,8 @@ export default {
|
|
|
return {
|
|
|
saving: false,
|
|
|
formData: {
|
|
|
- img: []
|
|
|
+ img: [],
|
|
|
+ tag: []
|
|
|
},
|
|
|
rules: {
|
|
|
name: [
|
|
|
@@ -110,7 +111,6 @@ export default {
|
|
|
{ label: '团队', value: 'TEAM' },
|
|
|
{ label: '个人', value: 'PERSONAL' }
|
|
|
],
|
|
|
- dynamicTags: [],
|
|
|
inputVisible: false,
|
|
|
inputValue: ''
|
|
|
};
|
|
|
@@ -157,8 +157,8 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
- handleClose(tag) {
|
|
|
- this.dynamicTags.splice(this.dynamicTags.indexOf(tag), 1);
|
|
|
+ removeTag(i) {
|
|
|
+ this.formData.tag.splice(i, 1);
|
|
|
},
|
|
|
showInput() {
|
|
|
this.inputVisible = true;
|
|
|
@@ -169,7 +169,7 @@ export default {
|
|
|
handleInputConfirm() {
|
|
|
let inputValue = this.inputValue;
|
|
|
if (inputValue) {
|
|
|
- this.dynamicTags.push(inputValue);
|
|
|
+ this.formData.tag.push(inputValue);
|
|
|
}
|
|
|
this.inputVisible = false;
|
|
|
this.inputValue = '';
|