1
This commit is contained in:
48
nx/index.js
Normal file
48
nx/index.js
Normal 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
|
||||
Reference in New Issue
Block a user