修改title偏移的问题。

pull/2/head
Xydawn 2022-01-12 10:48:07 +08:00
parent 50fe153448
commit f798ebe2b9
3 changed files with 20 additions and 19 deletions

View File

@ -1,13 +1,15 @@
<template> <template>
<div> <span>
<template v-if="icon.includes('el-icon')"> <template v-if="icon.includes('el-icon')">
<i :class="[icon, 'sub-el-icon']" /> <i :class="[icon, 'sub-el-icon']" />
<!-- <svg-icon :icon-class="icon" /> --> </template>
<template v-else>
<svg-icon :icon-class="icon" />
</template> </template>
<template v-if="title"> <template v-if="title">
<span slot="title">{{ title }}</span> <span slot="title" style="padding-left: 5px;">{{ title }}</span>
</template> </template>
</div> </span>
</template> </template>
<script> <script>
export default { export default {

View File

@ -51,7 +51,7 @@ export const constantRoutes = [
path: 'dashboard', path: 'dashboard',
name: 'Dashboard', name: 'Dashboard',
component: () => import('@/views/dashboard/index'), component: () => import('@/views/dashboard/index'),
meta: { title: 'Dashboard', icon: 'el-icon-s-help' } meta: { title: 'Dashboard', icon: 'dashboard' }
}] }]
}, },
@ -66,13 +66,13 @@ export const constantRoutes = [
path: 'table', path: 'table',
name: 'Table', name: 'Table',
component: () => import('@/views/table/index'), component: () => import('@/views/table/index'),
meta: { title: 'Table', icon: 'el-icon-s-help' } meta: { title: 'Table', icon: 'table' }
}, },
{ {
path: 'tree', path: 'tree',
name: 'Tree', name: 'Tree',
component: () => import('@/views/tree/index'), component: () => import('@/views/tree/index'),
meta: { title: 'Tree', icon: 'el-icon-s-help' } meta: { title: 'Tree', icon: 'tree' }
} }
] ]
}, },
@ -85,7 +85,7 @@ export const constantRoutes = [
path: 'index', path: 'index',
name: 'Form', name: 'Form',
component: () => import('@/views/form/index'), component: () => import('@/views/form/index'),
meta: { title: 'Form', icon: 'el-icon-s-help' } meta: { title: 'Form', icon: 'form' }
} }
] ]
}, },
@ -97,7 +97,7 @@ export const constantRoutes = [
name: 'Nested', name: 'Nested',
meta: { meta: {
title: 'Nested', title: 'Nested',
icon: 'el-icon-s-help' icon: 'nested'
}, },
children: [ children: [
{ {
@ -155,7 +155,7 @@ export const constantRoutes = [
children: [ children: [
{ {
path: 'https://panjiachen.github.io/vue-element-admin-site/#/', path: 'https://panjiachen.github.io/vue-element-admin-site/#/',
meta: { title: 'External Link', icon: 'el-icon-s-help' } meta: { title: 'External Link', icon: 'link' }
} }
] ]
}, },

View File

@ -58,7 +58,7 @@
} }
.sub-el-icon { .sub-el-icon {
margin-right: 17px; margin-right: 12px;
margin-left: -2px; margin-left: -2px;
} }
@ -108,27 +108,27 @@
padding: 0 !important; padding: 0 !important;
.svg-icon { .svg-icon {
margin-left: 18px; margin-left: 20px;
} }
.sub-el-icon { .sub-el-icon {
margin-left: 18px; margin-left: 19px;
} }
} }
} }
.el-submenu { & > .el-submenu {
overflow: hidden; overflow: hidden;
& > .el-submenu__title { & > .el-submenu__title {
padding: 0 !important; padding: 0 !important;
.svg-icon { .svg-icon {
margin-left: 18px; margin-left: 20px;
} }
.sub-el-icon { .sub-el-icon {
margin-left: 18px; margin-left: 19px;
} }
.el-submenu__icon-arrow { .el-submenu__icon-arrow {
@ -137,7 +137,7 @@
} }
} }
.el-menu--collapse { & > .el-menu--collapse {
.el-submenu { .el-submenu {
& > .el-submenu__title { & > .el-submenu__title {
& > span { & > span {
@ -189,7 +189,6 @@
& > .el-menu { & > .el-menu {
.svg-icon { .svg-icon {
margin-right: 16px; margin-right: 16px;
margin-left: -2px;
} }
.sub-el-icon { .sub-el-icon {
margin-right: 12px; margin-right: 12px;