From fdf964b18dc0479787734ad9569880fc57d43d2e Mon Sep 17 00:00:00 2001 From: Ryan Wang Date: Mon, 7 Nov 2022 15:12:15 +0800 Subject: [PATCH] perf: improve theme preview modal (#683) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #### What type of PR is this? /kind improvement /milestone 2.0 #### What this PR does / why we need it: 重构主题预览弹框,支持选择主题以及针对主题进行设置。 todolist: - [x] 支持保存之后自动刷新预览区域。 - [x] 优化 Tabs 组件,支持横向滚动以解决设置项过多时,选项卡的样式问题。 #### Screenshots: https://user-images.githubusercontent.com/21301288/200233823-fe317efe-536a-47a9-9495-efdde39be7ca.mp4 #### Special notes for your reviewer: 测试方式: 1. 需要先执行 `pnpm build:packages` 2. 进入主题管理,点击右上角的预览即可打开主题预览窗口 #### Does this PR introduce a user-facing change? ```release-note 重构主题预览弹框,支持选择主题以及针对主题进行设置。 ``` --- .../components/src/components/modal/Modal.vue | 3 + .../src/components/tabs/Tabbar.story.vue | 11 +- .../components/src/components/tabs/Tabbar.vue | 36 +- packages/components/src/icons/icons.ts | 2 + .../dashboard/widgets/QuickLinkWidget.vue | 78 ++-- src/modules/interface/themes/Visual.vue | 175 -------- .../themes/components/ThemeListModal.vue | 69 +--- .../components/preview/ThemeListItem.vue | 85 ++++ .../components/preview/ThemePreviewModal.vue | 383 ++++++++++++++++++ .../interface/themes/layouts/ThemeLayout.vue | 14 +- src/modules/interface/themes/module.ts | 16 - 11 files changed, 583 insertions(+), 289 deletions(-) delete mode 100644 src/modules/interface/themes/Visual.vue create mode 100644 src/modules/interface/themes/components/preview/ThemeListItem.vue create mode 100644 src/modules/interface/themes/components/preview/ThemePreviewModal.vue diff --git a/packages/components/src/components/modal/Modal.vue b/packages/components/src/components/modal/Modal.vue index 6b8572df..b9e319b0 100644 --- a/packages/components/src/components/modal/Modal.vue +++ b/packages/components/src/components/modal/Modal.vue @@ -103,6 +103,9 @@ watch( + + diff --git a/src/modules/interface/themes/module.ts b/src/modules/interface/themes/module.ts index 1c7c35f4..4a1e611c 100644 --- a/src/modules/interface/themes/module.ts +++ b/src/modules/interface/themes/module.ts @@ -1,9 +1,7 @@ import { definePlugin } from "@halo-dev/console-shared"; -import BlankLayout from "@/layouts/BlankLayout.vue"; import ThemeLayout from "./layouts/ThemeLayout.vue"; import ThemeDetail from "./ThemeDetail.vue"; import ThemeSetting from "./ThemeSetting.vue"; -import Visual from "./Visual.vue"; import { IconPalette } from "@halo-dev/components"; import { markRaw } from "vue"; @@ -42,19 +40,5 @@ export default definePlugin({ }, ], }, - { - path: "/theme/visual", - component: BlankLayout, - children: [ - { - path: "", - name: "ThemeVisual", - component: Visual, - meta: { - title: "可视化编辑", - }, - }, - ], - }, ], });