From 818226000e4f34b10a6c6d69378c750dd7896f9f Mon Sep 17 00:00:00 2001 From: Leo <98382335+gaoziman@users.noreply.github.com> Date: Sun, 6 Jul 2025 19:13:13 +0800 Subject: [PATCH] =?UTF-8?q?style:=20=E7=BB=9F=E4=B8=80=E6=A0=B8=E5=BF=83?= =?UTF-8?q?=E5=BA=94=E7=94=A8=E7=BB=84=E4=BB=B6=E5=92=8C=E9=80=9A=E7=94=A8?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E7=9A=84=E4=BB=A3=E7=A0=81=E5=9D=97=E6=8E=92?= =?UTF-8?q?=E5=B8=83=E9=A1=BA=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 调整 App.vue 和 components/common/ 下所有组件的代码块顺序 - 统一为 template → script → style 的规范排布 - 符合项目 Vue3 组件文件结构规范 - 保持代码功能不变,仅调整结构 --- src/components/common/CommonWrapper.vue | 3 +- src/layouts/components/header/UserCenter.vue | 102 --------- src/views/demo/dialog/index.vue | 221 ------------------- 3 files changed, 2 insertions(+), 324 deletions(-) delete mode 100644 src/layouts/components/header/UserCenter.vue delete mode 100644 src/views/demo/dialog/index.vue diff --git a/src/components/common/CommonWrapper.vue b/src/components/common/CommonWrapper.vue index f752769..a7b223c 100644 --- a/src/components/common/CommonWrapper.vue +++ b/src/components/common/CommonWrapper.vue @@ -1,4 +1,5 @@ - + -import { useAuthStore } from '@/store' -import { renderIcon } from '@/utils/icon' -import { coiMsgBox } from '@/utils/coi' -import IconBookOpen from '~icons/icon-park-outline/book-open' -import IconGithub from '~icons/icon-park-outline/github' -import IconLogout from '~icons/icon-park-outline/logout' -import IconUser from '~icons/icon-park-outline/user' - -const { t } = useI18n() - -const { userInfo, logout } = useAuthStore() -const router = useRouter() - -const options = computed(() => { - return [ - { - label: t('app.userCenter'), - key: 'userCenter', - icon: () => h(IconUser), - }, - { - type: 'divider', - key: 'd1', - }, - { - label: 'Github', - key: 'guthub', - icon: () => h(IconGithub), - }, - { - label: 'Gitee', - key: 'gitee', - icon: renderIcon('simple-icons:gitee'), - }, - { - label: 'Docs', - key: 'docs', - icon: () => h(IconBookOpen), - }, - { - type: 'divider', - key: 'd1', - }, - { - label: t('app.loginOut'), - key: 'loginOut', - icon: () => h(IconLogout), - }, - ] -}) -async function handleSelect(key: string | number) { - if (key === 'loginOut') { - try { - await coiMsgBox( - t('app.loginOutContent'), - t('app.loginOutTitle'), - t('common.confirm'), - t('common.cancel'), - 'info', - ) - logout() - } - catch { - // 用户取消操作,不需要处理 - } - } - if (key === 'userCenter') - router.push('/userCenter') - - if (key === 'guthub') - window.open('https://github.com/chansee97/nova-admin') - - if (key === 'gitee') - window.open('https://gitee.com/chansee97/nova-admin') - - if (key === 'docs') - window.open('https://nova-admin-docs.pages.dev/') -} - - - - - - - - - - - - - - - diff --git a/src/views/demo/dialog/index.vue b/src/views/demo/dialog/index.vue deleted file mode 100644 index 439aeed..0000000 --- a/src/views/demo/dialog/index.vue +++ /dev/null @@ -1,221 +0,0 @@ - - - - - - - - 基础弹框 - - - 自定义内容弹框 - - - 全屏弹框 - - - 无底部按钮弹框 - - - - - - - - - - 这是一个基础的弹框示例。 - - - 点击确定或取消按钮来关闭弹框。 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 全屏弹框内容 - - - - 这是全屏弹框中的内容区域。 - 可以放置任何复杂的内容和组件。 - - - 全屏模式下可以展示更多信息。 - 适用于复杂的表单或详细信息展示。 - - - - - - - - - - - - 这是一个没有底部按钮的弹框。 - - - 需要自定义关闭逻辑。 - - - - 自定义关闭 - - - 自定义操作 - - - - - - - - -
- 这是一个基础的弹框示例。 -
- 点击确定或取消按钮来关闭弹框。 -
这是全屏弹框中的内容区域。
可以放置任何复杂的内容和组件。
全屏模式下可以展示更多信息。
适用于复杂的表单或详细信息展示。
- 这是一个没有底部按钮的弹框。 -
- 需要自定义关闭逻辑。 -