解决所有bug 优化table内容
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
<template v-for="val in menuLists">
|
||||
<el-sub-menu :index="val.path" v-if="val.children && val.children.length > 0" :key="val.path">
|
||||
<template #title>
|
||||
<SvgIcon :name="val.meta.icon"/>
|
||||
<SvgIcon :name="getMenuIcon(val.meta.icon)"/>
|
||||
<span class="font-semibold">{{ $t(val.name.split('_')[0]) }}</span>
|
||||
</template>
|
||||
<SubItem :chil="val.children"/>
|
||||
@@ -15,12 +15,12 @@
|
||||
<el-menu-item :index="val.path" :key="val.path">
|
||||
<template #title v-if="!val.meta.isLink || (val.meta.isLink && val.meta.isIframe)">
|
||||
<!-- 此处可 指定 color='red' 等指定顶栏SVG颜色 -->
|
||||
<SvgIcon :name="val.meta.icon"/>
|
||||
<SvgIcon :name="getMenuIcon(val.meta.icon)"/>
|
||||
<p class="font-semibold">{{ $t(val.name.split('_')[0]) }}</p>
|
||||
</template>
|
||||
<template #title v-else>
|
||||
<a class="w100" @click.prevent="onALinkClick(val)">
|
||||
<SvgIcon :name="val.meta.icon"/>
|
||||
<SvgIcon :name="getMenuIcon(val.meta.icon)"/>
|
||||
{{ $t(val.name.split('_')[0]) }}
|
||||
</a>
|
||||
</template>
|
||||
@@ -66,6 +66,10 @@ const state = reactive({
|
||||
const menuLists = computed(() => {
|
||||
return <RouteItems>props.menuList;
|
||||
});
|
||||
// 获取菜单图标,如果没有则返回默认图标
|
||||
const getMenuIcon = (icon?: string) => {
|
||||
return icon && icon.trim() ? icon : 'ele-Menu';
|
||||
};
|
||||
// 设置横向滚动条可以鼠标滚轮滚动
|
||||
const onElMenuHorizontalScroll = (e: WheelEventType) => {
|
||||
const eventDelta = e.wheelDelta || -e.deltaY * 40;
|
||||
|
||||
@@ -2,27 +2,27 @@
|
||||
<template v-for="val in chils">
|
||||
<el-sub-menu :index="val.path" :key="val.path" v-if="val.children && val.children.length > 0">
|
||||
<template #title>
|
||||
<SvgIcon :name="val.meta.icon" />
|
||||
<SvgIcon :name="getMenuIcon(val.meta.icon)" />
|
||||
<!-- <span>{{ $t(val.name) }}</span>-->
|
||||
<span>{{ $t(val.name.split('_')[0]) }}</span>
|
||||
</template>
|
||||
<sub-item :chil="val.children" />
|
||||
<sub-item :chil="val.children" />
|
||||
</el-sub-menu>
|
||||
<template v-else>
|
||||
<el-menu-item :index="val.path" :key="val.path">
|
||||
<template v-if="!val.meta.isLink || (val.meta.isLink && val.meta.isIframe)">
|
||||
<SvgIcon :name="val.meta.icon" />
|
||||
<SvgIcon :name="getMenuIcon(val.meta.icon)" />
|
||||
<!-- <span>{{ $t(val.name) }}</span>-->
|
||||
<span>{{ $t(val.name.split('_')[0]) }}</span>
|
||||
</template>
|
||||
<template v-else>
|
||||
<a class="w100" @click.prevent="onALinkClick(val)">
|
||||
<SvgIcon :name="val.meta.icon" />
|
||||
<SvgIcon :name="getMenuIcon(val.meta.icon)" />
|
||||
<!-- {{ $t(val.name) }}-->
|
||||
{{ $t(val.name.split('_')[0]) }}
|
||||
</a>
|
||||
</template>
|
||||
</el-menu-item>
|
||||
</el-menu-item>
|
||||
</template>
|
||||
</template>
|
||||
</template>
|
||||
@@ -45,6 +45,10 @@ const props = defineProps({
|
||||
const chils = computed(() => {
|
||||
return <RouteItems>props.chil;
|
||||
});
|
||||
// 获取菜单图标,如果没有则返回默认图标
|
||||
const getMenuIcon = (icon?: string) => {
|
||||
return icon && icon.trim() ? icon : 'ele-Menu';
|
||||
};
|
||||
// 打开外部链接
|
||||
const onALinkClick = (val: RouteItem) => {
|
||||
other.handleOpenLink(val);
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<!-- 三级菜单 -->
|
||||
<el-sub-menu :index="val.path" v-if="val.children && val.children.length > 0" :key="val.path">
|
||||
<template #title>
|
||||
<SvgIcon :name="val.meta.icon" />
|
||||
<SvgIcon :name="getMenuIcon(val.meta.icon)" />
|
||||
<span>{{ $t(val.name.split('_')[0]) }}</span>
|
||||
</template>
|
||||
<SubItem :chil="val.children" />
|
||||
@@ -19,7 +19,7 @@
|
||||
<template v-else>
|
||||
<!-- 二级菜单 -->
|
||||
<el-menu-item :index="val.path" :key="val.path">
|
||||
<SvgIcon :name="val.meta.icon" />
|
||||
<SvgIcon :name="getMenuIcon(val.meta.icon)" />
|
||||
<template #title v-if="!val.meta.isLink || (val.meta.isLink && val.meta.isIframe)">
|
||||
<span>{{ $t(val.name.split('_')[0]) }}</span>
|
||||
</template>
|
||||
@@ -62,6 +62,10 @@ const state = reactive({
|
||||
const menuLists = computed(() => {
|
||||
return <RouteItems>props.menuList;
|
||||
});
|
||||
// 获取菜单图标,如果没有则返回默认图标
|
||||
const getMenuIcon = (icon?: string) => {
|
||||
return icon && icon.trim() ? icon : 'ele-Menu';
|
||||
};
|
||||
// 获取布局配置信息
|
||||
const getThemeConfig = computed(() => {
|
||||
return themeConfig.value;
|
||||
|
||||
Reference in New Issue
Block a user