This commit is contained in:
houjunxiang
2025-10-09 18:19:55 +08:00
parent f2ffc65094
commit 386f1e7466
1553 changed files with 284685 additions and 32820 deletions

48
nx/index.js Normal file
View File

@@ -0,0 +1,48 @@
import $router from '@/nx/router'
import $helper from '@/nx/helper'
import $store from '@/nx/store'
import $measure from '@/nx/helper/measure'
import $print from '@/nx/helper/print'
import $api from '@/nx/api'
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 nx = {
$store,
$router,
$helper,
$measure,
$print,
$dayjs: dayjs,
$api
}
// 加载Nx底层依赖
export async function NxInit() {
if (process.env.NODE_ENV === 'development') {
NxDebug()
}
// #ifdef MP-WEIXIN
// 检测小程序更新
// wechat.checkMiniProgramUpdate()
// #endif
}
// 开发模式
function NxDebug() {
// 开发环境引入vconsole调试
// #ifdef H5
// import("vconsole").then(vconsole => {
// new vconsole.default();
// });
// #endif
}
export default nx