增加重置按钮

This commit is contained in:
2023-11-02 16:06:37 +08:00
parent dac73754e1
commit 1a91476536
2 changed files with 12 additions and 3 deletions

View File

@@ -49,7 +49,8 @@
name: '',
value: ''
}
]
],
originalValue: ''
};
},
watch: {
@@ -65,6 +66,7 @@
created() {
if (this.setting.value) {
this.originalValue = this.setting.value;
if (typeof this.setting.value === 'string') {
this.setting.value = JSON.parse(this.setting.value);
}
@@ -81,7 +83,13 @@
template: propertyInputTemplate,
methods: {
onResetItem() {
if (typeof this.originalValue === 'string') {
this.listItem = JSON.parse(this.originalValue);
} else {
this.listItem = this.originalValue;
}
},
removeItem(item, index) {
this.listTag.splice(index, 1);
},