mall-app-b/peach/index.js

53 lines
1.2 KiB
JavaScript
Raw Permalink Normal View History

2024-04-30 17:45:03 +08:00
import $url from '@/peach/url'
import $router from '@/peach/router'
import $platform from '@/peach/platform'
import $helper from '@/peach/helper'
import zIndex from '@/peach/config/zIndex.js'
import $store from '@/peach/store'
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,
$url,
$router,
$platform,
$helper,
$zIndex: zIndex,
}
// 加载底层依赖
export async function peachInit() {
// 应用初始化
2024-05-10 20:29:20 +08:00
// await $store('app').init()
2024-04-30 17:45:03 +08:00
// 平台初始化加载(各平台provider提供不同的加载流程)
$platform.load()
2024-05-10 20:29:20 +08:00
console.log($platform)
2024-04-30 17:45:03 +08:00
if (process.env.NODE_ENV === 'development') {
debug()
}
}
// 开发模式
function debug() {
// 开发环境引入vconsole调试
// #ifdef H5
// import("vconsole").then(vconsole => {
// new vconsole.default();
// });
// #endif
// TODO 芋艿:可以打印路由
// 同步前端页面到后端
// console.log(ROUTES)
}
export default peach