refactor: rename categories to defaultCategories and initialize categories from it
parent
d1fd625972
commit
408e79ff12
|
|
@ -128,8 +128,7 @@ const loading = ref(false)
|
||||||
const searchValue = ref('')
|
const searchValue = ref('')
|
||||||
const folderId = ref('')
|
const folderId = ref('')
|
||||||
const toolType = ref('INTERNAL')
|
const toolType = ref('INTERNAL')
|
||||||
|
const defaultCategories = ref<ToolCategory[]>([
|
||||||
const categories = ref<ToolCategory[]>([
|
|
||||||
// 第一版不上
|
// 第一版不上
|
||||||
// {
|
// {
|
||||||
// id: 'recommend',
|
// id: 'recommend',
|
||||||
|
|
@ -162,6 +161,8 @@ const categories = ref<ToolCategory[]>([
|
||||||
// tools: []
|
// tools: []
|
||||||
// }
|
// }
|
||||||
])
|
])
|
||||||
|
const categories = ref<ToolCategory[]>([...defaultCategories.value])
|
||||||
|
|
||||||
const filterList = ref<any>(null)
|
const filterList = ref<any>(null)
|
||||||
|
|
||||||
function getSubTitle(tool: any) {
|
function getSubTitle(tool: any) {
|
||||||
|
|
@ -188,6 +189,7 @@ async function getList() {
|
||||||
|
|
||||||
async function getInternalToolList() {
|
async function getInternalToolList() {
|
||||||
try {
|
try {
|
||||||
|
categories.value = defaultCategories.value
|
||||||
const res = await ToolStoreApi.getInternalToolList({ name: searchValue.value }, loading)
|
const res = await ToolStoreApi.getInternalToolList({ name: searchValue.value }, loading)
|
||||||
if (searchValue.value.length) {
|
if (searchValue.value.length) {
|
||||||
filterList.value = res.data
|
filterList.value = res.data
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue