| 1234567891011121314151617181920212223242526272829303132333435363738394041 |
- // main.js(Vue 2)
- import Vue from 'vue'
- import App from './App'
- import * as filters from './utils/filters.js'
- import store from './store'
- import uView from 'uview-ui'
- import config from '@/config/config'
- import JessibucaPlugin from './utils/jessibuca-plugin'
- // 注册全局过滤器
- Object.keys(filters).forEach((key) => {
- Vue.filter(key, filters[key])
- })
- // 全局挂载变量(通过 Vue.prototype)
- // Vue.prototype.$mainColor = config.mainColor
- // Vue.prototype.$lightColor = config.lightColor
- // Vue.prototype.$aiderLightColor = config.aiderLightColor
- // 使用 Vuex store
- Vue.use(store)
- // 使用 uView UI
- Vue.use(uView)
- // 动态加载 Jessibuca 插件,仅限 H5
- // #ifdef H5
- if (typeof window !== 'undefined') {
- Vue.use(JessibucaPlugin)
- }
- // #endif
- Vue.config.productionTip = false
- App.mpType = 'app'
- const app = new Vue({
- store,
- ...App
- })
- app.$mount() // 必须是这样写,不要在这里指定挂载节点
|