mirror of
https://gitee.com/ulthon/ulthon_admin.git
synced 2026-07-08 11:02:48 +08:00
增加重置按钮
This commit is contained in:
@@ -15,7 +15,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="input-item" slot="footer">
|
<div class="input-item" slot="footer">
|
||||||
<div class="layui-btn layui-btn-primary" @click="onAddItem"><i class="layui-icon layui-icon-add-1"></i></div>
|
<div class="layui-btn layui-btn-primary" @click="onAddItem" title="增加"><i class="layui-icon layui-icon-add-1"></i></div>
|
||||||
|
<div class="layui-btn layui-btn-primary" @click="onResetItem" title="重置"><i class="layui-icon layui-icon-refresh"></i></div>
|
||||||
</div>
|
</div>
|
||||||
</draggable>
|
</draggable>
|
||||||
|
|
||||||
|
|||||||
@@ -49,7 +49,8 @@
|
|||||||
name: '',
|
name: '',
|
||||||
value: ''
|
value: ''
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
originalValue: ''
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
@@ -65,6 +66,7 @@
|
|||||||
|
|
||||||
created() {
|
created() {
|
||||||
if (this.setting.value) {
|
if (this.setting.value) {
|
||||||
|
this.originalValue = this.setting.value;
|
||||||
if (typeof this.setting.value === 'string') {
|
if (typeof this.setting.value === 'string') {
|
||||||
this.setting.value = JSON.parse(this.setting.value);
|
this.setting.value = JSON.parse(this.setting.value);
|
||||||
}
|
}
|
||||||
@@ -81,7 +83,13 @@
|
|||||||
template: propertyInputTemplate,
|
template: propertyInputTemplate,
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
onResetItem() {
|
||||||
|
if (typeof this.originalValue === 'string') {
|
||||||
|
this.listItem = JSON.parse(this.originalValue);
|
||||||
|
} else {
|
||||||
|
this.listItem = this.originalValue;
|
||||||
|
}
|
||||||
|
},
|
||||||
removeItem(item, index) {
|
removeItem(item, index) {
|
||||||
this.listTag.splice(index, 1);
|
this.listTag.splice(index, 1);
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user