@@ -5,17 +5,18 @@ import { Edit, Delete } from '@element-plus/icons-vue'
55import type { FormInstance , FormRules } from ' element-plus'
66import type { Pair } from ' ./types'
77
8- const stores = ref ([] as Store [])
9- const dialogVisible = ref (false )
10- const creatingLoading = ref (false )
11- const storeFormRef = ref <FormInstance >()
12- const store = ref ({
8+ const emptyStore = {
139 kind: {},
1410 properties: [{
1511 key: ' ' ,
1612 value: ' '
1713 }]
18- } as Store )
14+ } as Store
15+ const stores = ref ([] as Store [])
16+ const dialogVisible = ref (false )
17+ const creatingLoading = ref (false )
18+ const storeFormRef = ref <FormInstance >()
19+ const store = ref (emptyStore )
1920const createAction = ref (true )
2021const storeForm = reactive (store )
2122
@@ -78,6 +79,7 @@ function editStore(name: string) {
7879}
7980
8081function addStore() {
82+ store .value = emptyStore
8183 dialogVisible .value = true
8284 createAction .value = true
8385}
@@ -134,6 +136,7 @@ function updateKeys() {
134136 <div >Store Manager</div >
135137 <div >
136138 <el-button type =" primary" @click =" addStore" :icon =" Edit" >New</el-button >
139+ <el-button type =" primary" @click =" loadStores" >Refresh</el-button >
137140 </div >
138141 <el-table :data =" stores" style =" width : 100% " >
139142 <el-table-column label =" Name" width =" 180" >
0 commit comments