You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
991 B

8 months ago
import { createSSRApp } from 'vue'
import * as Pinia from 'pinia'
// @ts-ignore
import uView from 'vk-uview-ui'
import App from './App.vue'
import tab from './plugins/tab'
import modal from './plugins/modal'
import time from './plugins/time'
// unocss
import 'uno.css'
import { accessTimeInAnHour, getNowFormatDate } from "./utils/dateTime";
export function createApp() {
const app = createSSRApp(App)
app.use(Pinia.createPinia())
app.use(uView)
// 解决onLaunch和onLoad异步问题
app.config.globalProperties.$onLaunched = new Promise(resolve => {
app.config.globalProperties.$isResolve = resolve
})
// 页签操作
app.config.globalProperties.$tab = tab
// 模态框对象
app.config.globalProperties.$modal = modal
// 时间对象
app.config.globalProperties.$time = time
return {
app,
// uni-app 官方文档示例 https://zh.uniapp.dcloud.io/tutorial/vue3-pinia.html#%E7%8A%B6%E6%80%81%E7%AE%A1%E7%90%86-pinia
Pinia // 此处必须将 Pinia 返回
}
}