feat: 添加目录、菜单文字超出显示 Tooltip 文字提示demo

This commit is contained in:
xiaoxian521 2022-12-02 17:57:51 +08:00
parent 86b77c2877
commit 1a39d0962e
7 changed files with 48 additions and 19 deletions

View File

@ -101,6 +101,8 @@ menus:
hsPureTableBase: Base Usage
hsPureTableHigh: High Usage
hsTree: Big Data Tree
hsMenuoverflow: Menu Overflow Show Tooltip Text
hsChildMenuoverflow: Child Menu Overflow Show Tooltip Text
status:
hsLoad: Loading...
login:

View File

@ -101,6 +101,8 @@ menus:
hsPureTableBase: 基础用法23个示例
hsPureTableHigh: 高级用法8个示例
hsTree: 大数据树业务组件
hsMenuoverflow: 目录超出显示 Tooltip 文字提示
hsChildMenuoverflow: 菜单超出显示 Tooltip 文字提示
status:
hsLoad: 加载中...
login:

View File

@ -203,7 +203,7 @@ function resolvePath(routePath) {
placement="top"
:effect="tooltipEffect"
:offset="-10"
:disabled="!onlyOneChild.showTooltip"
:disabled="!isCollapse && !onlyOneChild.showTooltip"
>
<template #content>
{{ transformI18n(onlyOneChild.meta.title) }}
@ -249,7 +249,7 @@ function resolvePath(routePath) {
placement="top"
:effect="tooltipEffect"
:offset="-10"
:disabled="!isCollapse || !props.item.showTooltip"
:disabled="!props.item.showTooltip"
>
<template #content>
{{ transformI18n(props.item.meta.title) }}

View File

@ -15,15 +15,8 @@ const showLogo = ref(
storageLocal.getItem<StorageConfigs>("responsive-configure")?.showLogo ?? true
);
const {
routers,
device,
pureApp,
isCollapse,
tooltipEffect,
menuSelect,
toggleSideBar
} = useNav();
const { routers, device, pureApp, isCollapse, menuSelect, toggleSideBar } =
useNav();
const subMenuData = ref([]);
@ -76,7 +69,6 @@ watch(
router
unique-opened
mode="vertical"
:popper-effect="tooltipEffect"
class="outer-most select-none"
:collapse="isCollapse"
:default-active="route.path"

View File

@ -13,13 +13,14 @@ const home = 0, // 平台规定只有 home 路由的 rank 才能为 0 ,所以
list = 10,
permission = 11,
system = 12,
tabs = 13,
formdesign = 14,
flowchart = 15,
ppt = 16,
editor = 17,
guide = 18,
about = 19;
menuoverflow = 13,
tabs = 14,
formdesign = 15,
flowchart = 16,
ppt = 17,
editor = 18,
guide = 19,
about = 20;
export {
home,
@ -35,6 +36,7 @@ export {
list,
permission,
system,
menuoverflow,
tabs,
formdesign,
flowchart,

View File

@ -0,0 +1,22 @@
import { $t } from "@/plugins/i18n";
import { menuoverflow } from "@/router/enums";
export default {
path: "/menuoverflow",
redirect: "/menuoverflow/index",
meta: {
title: $t("menus.hsMenuoverflow"),
rank: menuoverflow
},
children: [
{
path: "/menuoverflow/index",
name: "MenuOverflow",
component: () => import("@/views/menuoverflow/index.vue"),
meta: {
title: $t("menus.hsChildMenuoverflow"),
showParent: true
}
}
]
} as RouteConfigsTable;

View File

@ -0,0 +1,9 @@
<script setup lang="ts">
defineOptions({
name: "MenuOverflow"
});
</script>
<template>
<div>目录菜单文字超出显示 Tooltip 文字提示</div>
</template>