Skip to content

Commit 2e23e82

Browse files
authored
fix: the store creation dialog state is incorrect (#167)
1 parent cfd1d42 commit 2e23e82

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

console/atest-ui/src/App.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ const viewName = ref('testcase')
200200
<div class="common-layout" data-title="Welcome!" data-intro="Welcome to use api-testing! 👋">
201201
<el-container style="height: 100%">
202202
<el-header style="height: 30px;justify-content: flex-end;">
203-
<el-button type="primary" :icon="Share" @click="viewName = ''" />
203+
<el-button type="primary" :icon="Share" @click="viewName = ''" data-intro="Manage the store backends." />
204204
</el-header>
205205

206206
<el-main>

console/atest-ui/src/views/StoreManager.vue

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,18 @@ import { Edit, Delete } from '@element-plus/icons-vue'
55
import type { FormInstance, FormRules } from 'element-plus'
66
import 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)
1920
const createAction = ref(true)
2021
const storeForm = reactive(store)
2122
@@ -78,6 +79,7 @@ function editStore(name: string) {
7879
}
7980
8081
function 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

Comments
 (0)