mall-app-t/peach/index.js

46 lines
1015 B
JavaScript
Raw Permalink Normal View History

2024-05-22 15:42:13 +08:00
import $store from '@/peach/store'
import $platform from '@/peach/platform'
import $url from '@/peach/url'
import $router from '@/peach/router'
2024-05-22 18:05:56 +08:00
import $helper from '@/peach/helper'
import zIndex from '@/peach/config/zIndex.js'
2024-05-22 15:42:13 +08:00
import dayjs from 'dayjs'
import relativeTime from 'dayjs/plugin/relativeTime'
import duration from 'dayjs/plugin/duration'
import 'dayjs/locale/zh-cn'
dayjs.locale('zh-cn')
dayjs.extend(relativeTime)
dayjs.extend(duration)
const peach = {
$store,
$platform,
$url,
$router,
2024-05-22 18:05:56 +08:00
$helper,
$zIndex: zIndex,
2024-05-22 15:42:13 +08:00
}
export async function peachInit() {
// 应用初始化
await $store('app').init()
// 平台初始化加载(各平台 provider 提供不同加载流程)
// debug
if (process.env.NODE_ENV === 'development') {
debug()
}
}
function debug() {
// #ifdef H5
import('vconsole').then((vconsole) => {
new vconsole.default()
})
// #endif
}
export default peach