main.js
1.0 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import Vue from 'vue'
import App from './App'
Vue.config.productionTip = false
import {
router,
RouterMount
} from '@/common/router.js'
Vue.use(router)
App.mpType = 'app'
const app = new Vue({
...App
})
//v1.3.5起 H5端 你应该去除原有的app.$mount();使用路由自带的渲染方式
// #ifdef H5
RouterMount(app, router, '#app')
// #endif
// #ifndef H5
app.$mount(); //为了兼容小程序及app端必须这样写才有效果
// #endif
//自定义工具库
uni.$u={}
require('@/common/request.js')
// const componentsContext = require.context('./components', true, /Base[A-Z]\w+\.(vue|js)$/);
// console.log('????',componentsContext,componentsContext.keys());
// componentsContext.keys().forEach(component => {
// // 获取文件中的 default 模块
// componentConfig.name
// const componentConfig = componentsContext(component).default;
// console.log(componentsContext(component).default);
// Vue.component(componentConfig.name, componentConfig)
// })