49 lines
960 B
JavaScript
49 lines
960 B
JavaScript
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
|