diff --git a/src/utils/index.ts b/src/utils/index.ts index 8176d88b..94b4c333 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -1,5 +1,11 @@ -import { isEmpty } from 'lodash'; +import { createApp } from 'vue'; +import { createPinia } from 'pinia'; import { commonStore } from '@/store'; +import App from '@/App.vue'; +const app = createApp(App); +const pinia = createPinia(); +app.use(pinia); +const { common } = commonStore(); // 定义一组预定义的颜色数组,用于在各种场景中轻松引用这些颜色 // 这些颜色包括从白色到黑色的不同灰度,以及一些鲜艳的颜色,格式有十六进制、RGB、RGBA、HSV、HSL等 export const predefine_colors = ['#fff', '#ddd', '#ccc', '#999', '#666', '#333', '#000', '#ff4500', '#ff8c00', '#ffd700', '#90ee90', '#00ced1', '#c71585', 'rgba(255, 69, 0, 0.68)', 'rgb(255, 120, 0)', 'hsv(51, 100, 98)', 'hsva(120, 40, 94, 0.5)', 'hsl(181, 100%, 37%)', '#1F93FF', '#c7158577']; @@ -335,7 +341,6 @@ export const tabs_style = (color: string, style: string | number | boolean | und * @returns {Promise} 返回一个Promise,解析为包含资源URL的字符串 */ export const online_url = async (directory: string) => { - const { common } = commonStore(); const attachemnt_host = common.config.attachment_host; if (import.meta.env.VITE_APP_BASE_API == '/dev-api') { let temp_data = await import(import.meta.env.VITE_APP_BASE_API == '/dev-api' ? '../../temp.d' : '../../temp_pro.d'); diff --git a/src/views/layout/components/main/default/footer-nav.ts b/src/views/layout/components/main/default/footer-nav.ts index 3951bc37..829f4168 100644 --- a/src/views/layout/components/main/default/footer-nav.ts +++ b/src/views/layout/components/main/default/footer-nav.ts @@ -2,10 +2,7 @@ import defaultCommon from './index'; import { online_url } from '@/utils'; import { onActivated } from 'vue'; -const new_url = ref(''); -onActivated(async () => { - new_url.value = await online_url('/static/app/tabbar/').then((res) => res); -}); +const new_url = await online_url('/static/app/tabbar/').then((res) => res); interface DefaultFooterNav { content: { nav_style: string;