diff --git a/dashboard/src/components/shared/ListConfigItem.vue b/dashboard/src/components/shared/ListConfigItem.vue index 9105b572..c166b249 100644 --- a/dashboard/src/components/shared/ListConfigItem.vue +++ b/dashboard/src/components/shared/ListConfigItem.vue @@ -3,12 +3,36 @@ - + {{ item }} - - mdi-close - + +
+ + mdi-pencil + + + mdi-close + +
+
+ + mdi-check + + + mdi-close + +
@@ -41,6 +65,8 @@ export default { return { newItem: '', items: this.value, + editIndex: -1, + editItem: '', }; }, watch: { @@ -58,6 +84,20 @@ export default { removeItem(index) { this.items.splice(index, 1); }, + startEdit(index, item) { + this.editIndex = index; + this.editItem = item; + }, + saveEdit() { + if (this.editItem.trim() !== '') { + this.items[this.editIndex] = this.editItem.trim(); + this.cancelEdit(); + } + }, + cancelEdit() { + this.editIndex = -1; + this.editItem = ''; + }, }, }; @@ -82,4 +122,8 @@ export default { .v-btn { margin-left: 8px; } + +.edit-btn { + margin-right: -8px; +} \ No newline at end of file