From bc548d500cde643e6b7c7e058da8982343a322db Mon Sep 17 00:00:00 2001 From: xiaoxian521 <1923740402@qq.com> Date: Thu, 15 Dec 2022 12:41:02 +0800 Subject: [PATCH] chore: update `@pureadmin/theme` latest --- build/plugins.ts | 9 +-------- package.json | 2 +- pnpm-lock.yaml | 8 ++++---- src/layout/theme/index.ts | 11 ++++------- types/shims-vue.d.ts | 3 --- 5 files changed, 10 insertions(+), 23 deletions(-) diff --git a/build/plugins.ts b/build/plugins.ts index 58af6d9..91e75ed 100644 --- a/build/plugins.ts +++ b/build/plugins.ts @@ -33,14 +33,7 @@ export function getPluginsList( themePreprocessorPlugin({ scss: { multipleScopeVars: genScssMultipleScopeVars(), - // 在生产模式是否抽取独立的主题css文件,extract为true以下属性有效 - extract: true, - // 会选取defaultScopeName对应的主题css文件在html添加link - themeLinkTagId: "head", - // "head"||"head-prepend" || "body" ||"body-prepend" - themeLinkTagInjectTo: "head", - // 是否对抽取的css文件内对应scopeName的权重类名移除 - removeCssScopeName: false + extract: true } }), // svg组件化支持 diff --git a/package.json b/package.json index 6758dee..e55ba83 100644 --- a/package.json +++ b/package.json @@ -58,7 +58,7 @@ "@iconify-icons/ep": "^1.2.7", "@iconify-icons/ri": "^1.2.3", "@iconify/vue": "^4.0.0", - "@pureadmin/theme": "^2.4.0", + "@pureadmin/theme": "^3.0.0", "@types/element-resize-detector": "1.1.3", "@types/js-cookie": "^3.0.1", "@types/mockjs": "^1.0.7", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6b0905d..9216d4b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -8,7 +8,7 @@ specifiers: "@iconify/vue": ^4.0.0 "@pureadmin/descriptions": ^1.1.0 "@pureadmin/table": ^1.9.0 - "@pureadmin/theme": ^2.4.0 + "@pureadmin/theme": ^3.0.0 "@pureadmin/utils": ^1.8.5 "@types/element-resize-detector": 1.1.3 "@types/js-cookie": ^3.0.1 @@ -111,7 +111,7 @@ devDependencies: "@iconify-icons/ep": 1.2.10 "@iconify-icons/ri": 1.2.4 "@iconify/vue": 4.0.2_vue@3.2.45 - "@pureadmin/theme": 2.4.0 + "@pureadmin/theme": 3.0.0 "@types/element-resize-detector": 1.1.3 "@types/js-cookie": 3.0.2 "@types/mockjs": 1.0.7 @@ -1041,10 +1041,10 @@ packages: vue: 3.2.45 dev: false - /@pureadmin/theme/2.4.0: + /@pureadmin/theme/3.0.0: resolution: { - integrity: sha512-aqX2O5WpqOCUiy6jhle92Pj7gDqF1/cHPWD+fWcDmmgmV7l7zqEDMWmZI1Iueg55fGxR39D400LaD2VrE8ihGA== + integrity: sha512-1qs0fve9DY4XgI5xafTd9qRPuWSo2QGON7avBqKSSSjXpCbo2BOccsH6qh5N2BxVBVZQJBYZoMq3bAUdK2Q0Jw== } dependencies: "@zougt/some-loader-utils": 1.4.3 diff --git a/src/layout/theme/index.ts b/src/layout/theme/index.ts index 7e2c166..6180ab6 100644 --- a/src/layout/theme/index.ts +++ b/src/layout/theme/index.ts @@ -2,10 +2,7 @@ * @description ⚠️:此文件仅供主题插件使用,请不要在此文件中导出别的工具函数(仅在页面加载前运行) */ -type MultipleScopeVarsItem = { - scopeName: string; - varsContent: string; -}; +import { type multipleScopeVarsOptions } from "@pureadmin/theme"; /** 预设主题色 */ const themeColors = { @@ -113,8 +110,8 @@ const themeColors = { /** * @description 将预设主题色处理成主题插件所需格式 */ -export const genScssMultipleScopeVars = (): MultipleScopeVarsItem[] => { - const result = [] as MultipleScopeVarsItem[]; +export const genScssMultipleScopeVars = (): multipleScopeVarsOptions[] => { + const result = [] as multipleScopeVarsOptions[]; Object.keys(themeColors).forEach(key => { result.push({ scopeName: `layout-theme-${key}`, @@ -129,7 +126,7 @@ export const genScssMultipleScopeVars = (): MultipleScopeVarsItem[] => { $menuTitleHover: ${themeColors[key].menuTitleHover} !default; $menuActiveBefore: ${themeColors[key].menuActiveBefore} !default; ` - } as MultipleScopeVarsItem); + } as multipleScopeVarsOptions); }); return result; }; diff --git a/types/shims-vue.d.ts b/types/shims-vue.d.ts index b6d2891..9fa8db3 100644 --- a/types/shims-vue.d.ts +++ b/types/shims-vue.d.ts @@ -8,6 +8,3 @@ declare module "*.scss" { const scss: Record; export default scss; } - -declare module "@pureadmin/theme"; -declare module "@pureadmin/theme/dist/browser-utils";