You've already forked template-MP-ts
移除传统的全局混入改为使用Vue3的全局暴露
This commit is contained in:
8
main.ts
8
main.ts
@@ -5,10 +5,10 @@ import App from './App.vue'
|
||||
// 创建应用实例
|
||||
const app = createApp(App)
|
||||
|
||||
// 全局混入
|
||||
// 提供全局变量
|
||||
// @ts-ignore
|
||||
import mixin from './mixins/global'
|
||||
app.use(mixin)
|
||||
const ASSETSURL: string = import.meta.env.VITE_ASSETSURL
|
||||
app.provide('ASSETSURL', ASSETSURL)
|
||||
|
||||
// 全局组件
|
||||
// @ts-ignore
|
||||
@@ -18,4 +18,4 @@ app.use(uView)
|
||||
// 挂载应用
|
||||
app.mount('#app')
|
||||
|
||||
export default app
|
||||
export default app
|
||||
|
||||
Reference in New Issue
Block a user