diff --git a/public/icons/bgGameCloud.png b/public/icons/bgGameCloud.png new file mode 100644 index 0000000..800b86c Binary files /dev/null and b/public/icons/bgGameCloud.png differ diff --git a/src/layout/GlobalMenu.tsx b/src/layout/GlobalMenu.tsx index 024ca91..e53267c 100644 --- a/src/layout/GlobalMenu.tsx +++ b/src/layout/GlobalMenu.tsx @@ -17,9 +17,9 @@ const defaultDisplay = { export const useMenuStore = defineStore('menu', () => { const display = reactive(defaultDisplay) const selectPage = ref<{ - id: string, - label: string, - name: string, + id: string + label: string + name: string }>() const showEditPage = ref(false) const mPos = { @@ -83,8 +83,8 @@ const Item = defineComponent({ style={ props.noStyle ? { - padding: '6px 10px' - } + padding: '6px 10px' + } : {} } onClick={() => { @@ -207,9 +207,11 @@ export default defineComponent(() => { alert onClick={() => { // 删除链接 - console.log(menu.selectPage); + console.log(menu.selectPage) - const idx = layout.state.content[layout.state.current].pages.findIndex(el => el.id === menu.selectPage?.id) + const idx = layout.state.content[layout.state.current].pages.findIndex( + (el) => el.id === menu.selectPage?.id + ) menu.dismiss() if (idx < 0) return @@ -315,7 +317,25 @@ export default defineComponent(() => { // 链接 return ( <> - 编辑 + { + useAdderPageStore().editBlockItem = { + id: block.id, + name: block.name, + link: block.link, + icon: block.icon, + text: block.text, + background: block.background, + color: block.color, + type: block.color ? 1 : 0 + } + router.go('global-adder') + useAdderPageStore().type = 2 + menu.dismiss() + }} + > + 编辑 + { diff --git a/src/layout/adder/AdderPage.tsx b/src/layout/adder/AdderPage.tsx index e2b3302..530af8a 100644 --- a/src/layout/adder/AdderPage.tsx +++ b/src/layout/adder/AdderPage.tsx @@ -145,29 +145,31 @@ export default defineComponent(() => { }))} /> - - { - if (store.type === 1) { - store.search(e) - } else if (store.type === 0) { - store.widgetSearchWords = e - } else if (store.type === 3) { - store.gameSearch = e + {store.type !== 2 && ( + + { + if (store.type === 1) { + store.search(e) + } else if (store.type === 0) { + store.widgetSearchWords = e + } else if (store.type === 3) { + store.gameSearch = e + } + }} + class="w-[220px]" + placeholder={ + store.type === 0 + ? '搜索想要添加的组件' + : store.type === 1 + ? '搜索想要添加的网址导航' + : store.type === 2 + ? '' + : '搜索想要添加的游戏' } - }} - class="w-[220px]" - placeholder={ - store.type === 0 - ? '搜索想要添加的组件' - : store.type === 1 - ? '搜索想要添加的网址导航' - : store.type === 2 - ? '' - : '搜索想要添加的游戏' - } - /> - + /> + + )}