diff --git a/pages.config.ts b/pages.config.ts index 7a9edb3..abb0a92 100644 --- a/pages.config.ts +++ b/pages.config.ts @@ -4,7 +4,7 @@ import { tabBar } from './src/tabbar/config' export default defineUniPages({ globalStyle: { navigationStyle: 'default', - navigationBarTitleText: 'unibest', + navigationBarTitleText: '芋道管理系统', navigationBarBackgroundColor: '#f8f8f8', navigationBarTextStyle: 'black', backgroundColor: '#FFFFFF', @@ -13,9 +13,9 @@ export default defineUniPages({ autoscan: true, custom: { '^fg-(.*)': '@/components/fg-$1/fg-$1.vue', + '^wd-(.*)': 'wot-design-uni/components/wd-$1/wd-$1.vue', '^(?!z-paging-refresh|z-paging-load-more)z-paging(.*)': 'z-paging/components/z-paging$1/z-paging$1.vue', - '^wd-(.*)': 'wot-design-uni/components/wd-$1/wd-$1.vue', }, }, // tabbar 的配置统一在 “./src/tabbar/config.ts” 文件中 diff --git a/src/App.ku.vue b/src/App.ku.vue index f157361..8aab489 100644 --- a/src/App.ku.vue +++ b/src/App.ku.vue @@ -1,9 +1,12 @@ diff --git a/src/store/theme.ts b/src/store/theme.ts new file mode 100644 index 0000000..c3f1c55 --- /dev/null +++ b/src/store/theme.ts @@ -0,0 +1,42 @@ +import type { ConfigProviderThemeVars } from 'wot-design-uni' + +import { defineStore } from 'pinia' + +export const useThemeStore = defineStore( + 'theme-store', + () => { + /** 主题 */ + const theme = ref<'light' | 'dark'>('light') + + /** 主题变量 */ + const themeVars = ref({ + // colorTheme: 'red', + // buttonPrimaryBgColor: '#07c160', + // buttonPrimaryColor: '#07c160', + }) + + /** 设置主题变量 */ + const setThemeVars = (partialVars: Partial) => { + themeVars.value = { ...themeVars.value, ...partialVars } + } + + /** 切换主题 */ + const toggleTheme = () => { + theme.value = theme.value === 'light' ? 'dark' : 'light' + } + + return { + /** 设置主题变量 */ + setThemeVars, + /** 切换主题 */ + toggleTheme, + /** 主题变量 */ + themeVars, + /** 主题 */ + theme, + } + }, + { + persist: true, + }, +) diff --git a/src/tabbar/index.vue b/src/tabbar/index.vue index 20f2f10..eca89bd 100644 --- a/src/tabbar/index.vue +++ b/src/tabbar/index.vue @@ -108,7 +108,7 @@ function getImageByIndex(index: number, item: CustomTabBarItem) { - +