mall-app-t/peach/index.js

46 lines
1015 B
JavaScript

import $store from '@/peach/store'
import $platform from '@/peach/platform'
import $url from '@/peach/url'
import $router from '@/peach/router'
import $helper from '@/peach/helper'
import zIndex from '@/peach/config/zIndex.js'
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,
$helper,
$zIndex: zIndex,
}
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