Skip to content

Commit 408e79f

Browse files
committed
refactor: rename categories to defaultCategories and initialize categories from it
1 parent d1fd625 commit 408e79f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

ui/src/views/tool/toolStore/ToolStoreDialog.vue

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,7 @@ const loading = ref(false)
128128
const searchValue = ref('')
129129
const folderId = ref('')
130130
const toolType = ref('INTERNAL')
131-
132-
const categories = ref<ToolCategory[]>([
131+
const defaultCategories = ref<ToolCategory[]>([
133132
// 第一版不上
134133
// {
135134
// id: 'recommend',
@@ -162,6 +161,8 @@ const categories = ref<ToolCategory[]>([
162161
// tools: []
163162
// }
164163
])
164+
const categories = ref<ToolCategory[]>([...defaultCategories.value])
165+
165166
const filterList = ref<any>(null)
166167
167168
function getSubTitle(tool: any) {
@@ -188,6 +189,7 @@ async function getList() {
188189
189190
async function getInternalToolList() {
190191
try {
192+
categories.value = defaultCategories.value
191193
const res = await ToolStoreApi.getInternalToolList({ name: searchValue.value }, loading)
192194
if (searchValue.value.length) {
193195
filterList.value = res.data

0 commit comments

Comments
 (0)