This commit is contained in:
Pan 2019-02-15 14:54:57 +08:00
parent 8c18c000d4
commit 4e0559833f
4 changed files with 8 additions and 9 deletions

View file

@ -12,7 +12,7 @@ import chartsRouter from './modules/charts'
import tableRouter from './modules/table' import tableRouter from './modules/table'
import nestedRouter from './modules/nested' import nestedRouter from './modules/nested'
/** note: Submenu only appear when children.length>=1 /** note: sub-menu only appear when children.length>=1
* detail see https://panjiachen.github.io/vue-element-admin-site/guide/essentials/router-and-nav.html * detail see https://panjiachen.github.io/vue-element-admin-site/guide/essentials/router-and-nav.html
**/ **/
@ -25,7 +25,7 @@ import nestedRouter from './modules/nested'
* name:'router-name' the name is used by <keep-alive> (must set!!!) * name:'router-name' the name is used by <keep-alive> (must set!!!)
* meta : { * meta : {
roles: ['admin','editor'] will control the page roles (you can set multiple roles) roles: ['admin','editor'] will control the page roles (you can set multiple roles)
title: 'title' the name show in submenu and breadcrumb (recommend set) title: 'title' the name show in sub-menu and breadcrumb (recommend set)
icon: 'svg-name' the icon show in the sidebar icon: 'svg-name' the icon show in the sidebar
noCache: true if true, the page will no be cached(default is false) noCache: true if true, the page will no be cached(default is false)
breadcrumb: false if false, the item will hidden in breadcrumb(default is true) breadcrumb: false if false, the item will hidden in breadcrumb(default is true)

View file

@ -5,16 +5,16 @@ export default {
} }
}, },
mounted() { mounted() {
// In order to fix the click on menu on the ios device will trigger the mouseeleave bug // In order to fix the click on menu on the ios device will trigger the mouseleave bug
// https://github.com/PanJiaChen/vue-element-admin/issues/1135 // https://github.com/PanJiaChen/vue-element-admin/issues/1135
this.fixBugIniOS() this.fixBugIniOS()
}, },
methods: { methods: {
fixBugIniOS() { fixBugIniOS() {
const $submenu = this.$refs.submenu const $subMenu = this.$refs.subMenu
if ($submenu) { if ($subMenu) {
const handleMouseleave = $submenu.handleMouseleave const handleMouseleave = $subMenu.handleMouseleave
$submenu.handleMouseleave = (e) => { $subMenu.handleMouseleave = (e) => {
if (this.device === 'mobile') { if (this.device === 'mobile') {
return return
} }

View file

@ -9,7 +9,7 @@
</app-link> </app-link>
</template> </template>
<el-submenu v-else ref="submenu" :index="resolvePath(item.path)"> <el-submenu v-else ref="subMenu" :index="resolvePath(item.path)">
<template slot="title"> <template slot="title">
<item v-if="item.meta" :icon="item.meta.icon" :title="generateTitle(item.meta.title)" /> <item v-if="item.meta" :icon="item.meta.icon" :title="generateTitle(item.meta.title)" />
</template> </template>

View file

@ -1,7 +1,6 @@
<template> <template>
<el-scrollbar wrap-class="scrollbar-wrapper"> <el-scrollbar wrap-class="scrollbar-wrapper">
<el-menu <el-menu
:show-timeout="200"
:default-active="$route.path" :default-active="$route.path"
:collapse="isCollapse" :collapse="isCollapse"
:background-color="variables.menuBg" :background-color="variables.menuBg"