From d85b4e0e29a310052f4b14cb411f8b988a2222df Mon Sep 17 00:00:00 2001 From: liyang <1711467488@qq.com> Date: Fri, 2 Nov 2018 13:24:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Former-commit-id: 23dbf65aeb10765ddda7c8f4faa33d423d59f420 --- .../components/menu-side/index.vue | 2 +- src/plugin/d2admin/index.js | 27 +++++-------------- 2 files changed, 8 insertions(+), 21 deletions(-) diff --git a/src/layout/header-aside/components/menu-side/index.vue b/src/layout/header-aside/components/menu-side/index.vue index 54276a7..76e3585 100644 --- a/src/layout/header-aside/components/menu-side/index.vue +++ b/src/layout/header-aside/components/menu-side/index.vue @@ -59,7 +59,7 @@ export default { handler (val) { this.active = val[val.length - 1].path this.$nextTick(() => { - if (this.aside.length > 0) { + if (this.aside.length > 0 && this.$refs.menu) { this.$refs.menu.activeIndex = this.active } }) diff --git a/src/plugin/d2admin/index.js b/src/plugin/d2admin/index.js index 5fe7cdf..15d3c6e 100644 --- a/src/plugin/d2admin/index.js +++ b/src/plugin/d2admin/index.js @@ -3,8 +3,6 @@ import ElementUI from 'element-ui' import 'element-ui/lib/theme-chalk/index.css' // flex 布局库 import 'flex.css' -// store -import store from '@/store/index' // 组件 import '@/components' // svg 图标 @@ -16,28 +14,17 @@ import pluginOpen from '@/plugin/open' export default { async install (Vue, options) { - // 获得用户设置的全局尺寸 - const size = await store.dispatch('d2admin/db/get', { - dbName: 'sys', - path: 'size.value', - defaultValue: '', - user: true - }) - // Element - Vue.use(ElementUI, { - size - }) - // 插件 - Vue.use(pluginError) - Vue.use(pluginLog) - Vue.use(pluginOpen) - // 设置为 false 以阻止 vue 在启动时生成生产提示。 - // https://cn.vuejs.org/v2/api/#productionTip + // 设置为 false 以阻止 vue 在启动时生成生产提示。https://cn.vuejs.org/v2/api/#productionTip Vue.config.productionTip = false // 当前环境 Vue.prototype.$env = process.env.NODE_ENV // 当前的 baseUrl - // 简化代码中 process.env.BASE_URL 取值 Vue.prototype.$baseUrl = process.env.BASE_URL + // Element + Vue.use(ElementUI) + // 插件 + Vue.use(pluginError) + Vue.use(pluginLog) + Vue.use(pluginOpen) } }