diff --git a/src/layout/components/notice/noticeItem.vue b/src/layout/components/notice/noticeItem.vue index c7ecec26d..032e6ac42 100644 --- a/src/layout/components/notice/noticeItem.vue +++ b/src/layout/components/notice/noticeItem.vue @@ -2,6 +2,7 @@ import { ListItem } from "./data"; import { ref, PropType, nextTick } from "vue"; import { useNav } from "@/layout/hooks/useNav"; +import { deviceDetection } from "@pureadmin/utils"; const props = defineProps({ noticeItem: { @@ -15,6 +16,7 @@ const titleTooltip = ref(false); const descriptionRef = ref(null); const descriptionTooltip = ref(false); const { tooltipEffect } = useNav(); +const isMobile = deviceDetection(); function hoverTitle() { nextTick(() => { @@ -63,6 +65,7 @@ function hoverDescription(event, description) { :disabled="!titleTooltip" :content="props.noticeItem.title" placement="top-start" + :enterable="!isMobile" >
+ + {{ transformI18n(props.item.meta.title) }} +
- - {{ transformI18n(props.item.meta.title) }} - { moveToView(index); }; -const moveToView = (index: number): void => { +const moveToView = async (index: number): Promise => { const tabNavPadding = 10; if (!instance.refs["dynamic" + index]) return; const tabItemEl = instance.refs["dynamic" + index][0]; @@ -75,8 +75,13 @@ const moveToView = (index: number): void => { const scrollbarDomWidth = scrollbarDom.value ? scrollbarDom.value?.offsetWidth : 0; + + // 获取视图更新后dom + await nextTick(); + // 已有标签页总长度(包含溢出部分) const tabDomWidth = tabDom.value ? tabDom.value?.offsetWidth : 0; + scrollbarDomWidth <= tabDomWidth ? (isShowArrow.value = true) : (isShowArrow.value = false); @@ -188,6 +193,7 @@ function deleteDynamicTag(obj: any, current: any, tag?: string) { ): void => { if (other) { useMultiTagsStoreHook().handleTags("equal", [routerArrays[0], obj]); + dynamicTagView(); } else { delAliveRouteList = useMultiTagsStoreHook().handleTags("splice", "", { startIndex,