cli3改版基本完成
Former-commit-id: 637e58a7d3aef389a4ea51c179aaee17f421f34c [formerly 637e58a7d3aef389a4ea51c179aaee17f421f34c [formerly 637e58a7d3aef389a4ea51c179aaee17f421f34c [formerly 637e58a7d3aef389a4ea51c179aaee17f421f34c [formerly fc66dcb2e437ff46b2c36ec1e3bcce71a6461250 [formerly b6451dc60d4c1e6006a9fcd380656d2023436e64]]]]] Former-commit-id: c791410cda91e2df1b9808bfb032f0d3d68106ef Former-commit-id: 0c5197800cfae6f27f7ab792c887fb25a73a23e0 Former-commit-id: 208a8e77c0fada6e9d191a7d495615ec2ef9704d [formerly af8c1367ed65b626196ac156c8521257cc804d60] Former-commit-id: 1fdb571cea6ed9dba9ea02f4ba6ebfb5d89e1b2f Former-commit-id: 774a145ae0694612edf988d9992ef797ddf4f21d Former-commit-id: 03fc24d70365836d60360aa24e24dc7cb4520b91 Former-commit-id: bba4fd5552fa42da029fd6b310f5ee48558d5508 Former-commit-id: 2de81d34fb07248965677e8a3866c13089fa95e7
This commit is contained in:
94
src/main.js
94
src/main.js
@@ -1,12 +1,100 @@
|
||||
import 'babel-polyfill'
|
||||
import Vue from 'vue'
|
||||
import App from './App.vue'
|
||||
import App from './App'
|
||||
import ElementUI from 'element-ui'
|
||||
import 'element-ui/lib/theme-chalk/index.css'
|
||||
import 'simplemde/dist/simplemde.min.css'
|
||||
import 'github-markdown-css'
|
||||
import VCharts from 'v-charts'
|
||||
import screenfull from 'screenfull'
|
||||
import contentmenu from 'v-contextmenu'
|
||||
import 'v-contextmenu/dist/index.css'
|
||||
import vueJsonTreeView from 'vue-json-tree-view'
|
||||
import i18n from './i18n'
|
||||
import util from '@/libs/util'
|
||||
import store from '@/store/index'
|
||||
import { frameInRoutes } from '@/router/routes'
|
||||
import '@/assets/library/font-awesome-4.7.0/css/font-awesome.min.css'
|
||||
import '@/assets/icons/index'
|
||||
import '@/assets/library/highlight/styles/atom-one-light.css'
|
||||
import '@/components'
|
||||
import '@/plugin/axios'
|
||||
import '@/mock/register'
|
||||
import pluginImport from '@/plugin/import'
|
||||
import pluginExport from '@/plugin/export'
|
||||
import pluginLog from '@/plugin/log'
|
||||
import pluginOpen from '@/plugin/open'
|
||||
import router from './router'
|
||||
import store from './store'
|
||||
|
||||
Vue.use(ElementUI)
|
||||
Vue.use(VCharts)
|
||||
Vue.use(contentmenu)
|
||||
Vue.use(pluginImport)
|
||||
Vue.use(pluginExport)
|
||||
Vue.use(pluginLog)
|
||||
Vue.use(pluginOpen)
|
||||
Vue.use(vueJsonTreeView)
|
||||
|
||||
Vue.config.productionTip = false
|
||||
|
||||
Vue.prototype.$env = process.env.NODE_ENV
|
||||
Vue.prototype.$baseUrl = process.env.BASE_URL
|
||||
|
||||
new Vue({
|
||||
router,
|
||||
store,
|
||||
render: h => h(App)
|
||||
i18n,
|
||||
render: h => h(App),
|
||||
created () {
|
||||
// 处理路由 得到每一级的路由设置
|
||||
this.getAllTagFromRoutes()
|
||||
},
|
||||
mounted () {
|
||||
util.showInfo()
|
||||
// DB -> store 加载用户名
|
||||
this.$store.commit('d2adminUsernameLoad')
|
||||
// DB -> store 加载版本更新弹窗的设置
|
||||
this.$store.commit('d2adminUpdateNotifyLoad')
|
||||
// DB -> store 加载主题
|
||||
this.$store.commit('d2adminThemeLoad')
|
||||
// DB -> store 数据库加载上次退出时的多页列表
|
||||
this.$store.commit('d2adminPageOpenedListLoad')
|
||||
// D2Admin 开发环境检查更新
|
||||
util.checkUpdate(this)
|
||||
// 初始化全屏监听
|
||||
this.fullscreenListenerInit()
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* 初始化全屏监听
|
||||
*/
|
||||
fullscreenListenerInit () {
|
||||
if (screenfull.enabled) {
|
||||
screenfull.on('change', () => {
|
||||
if (!screenfull.isFullscreen) {
|
||||
this.$store.commit('d2adminFullScreenSet', false)
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 处理路由 得到每一级的路由设置
|
||||
*/
|
||||
getAllTagFromRoutes () {
|
||||
// 所有加载在主框架内的页面
|
||||
const pool = []
|
||||
const push = function (routes) {
|
||||
routes.forEach(route => {
|
||||
if (route.children) {
|
||||
push(route.children)
|
||||
} else {
|
||||
const { meta, name, path } = route
|
||||
pool.push({ meta, name, path })
|
||||
}
|
||||
})
|
||||
}
|
||||
push(frameInRoutes)
|
||||
this.$store.commit('d2adminTagPoolSet', pool)
|
||||
}
|
||||
}
|
||||
}).$mount('#app')
|
||||
|
||||
Reference in New Issue
Block a user