Merge branch 'main' into gitee

This commit is contained in:
xiaoxian521 2023-02-16 12:43:26 +08:00
commit 534d125c33
3 changed files with 13 additions and 4 deletions

View File

@ -2,6 +2,7 @@
import { ListItem } from "./data"; import { ListItem } from "./data";
import { ref, PropType, nextTick } from "vue"; import { ref, PropType, nextTick } from "vue";
import { useNav } from "@/layout/hooks/useNav"; import { useNav } from "@/layout/hooks/useNav";
import { deviceDetection } from "@pureadmin/utils";
const props = defineProps({ const props = defineProps({
noticeItem: { noticeItem: {
@ -15,6 +16,7 @@ const titleTooltip = ref(false);
const descriptionRef = ref(null); const descriptionRef = ref(null);
const descriptionTooltip = ref(false); const descriptionTooltip = ref(false);
const { tooltipEffect } = useNav(); const { tooltipEffect } = useNav();
const isMobile = deviceDetection();
function hoverTitle() { function hoverTitle() {
nextTick(() => { nextTick(() => {
@ -63,6 +65,7 @@ function hoverDescription(event, description) {
:disabled="!titleTooltip" :disabled="!titleTooltip"
:content="props.noticeItem.title" :content="props.noticeItem.title"
placement="top-start" placement="top-start"
:enterable="!isMobile"
> >
<div <div
ref="titleRef" ref="titleRef"

View File

@ -274,6 +274,9 @@ function resolvePath(routePath) {
:is="useRenderIcon(props.item.meta && toRaw(props.item.meta.icon))" :is="useRenderIcon(props.item.meta && toRaw(props.item.meta.icon))"
/> />
</div> </div>
<span v-if="layout === 'horizontal'">
{{ transformI18n(props.item.meta.title) }}
</span>
<div <div
:style="getSubMenuDivStyle(props.item)" :style="getSubMenuDivStyle(props.item)"
v-if=" v-if="
@ -284,9 +287,6 @@ function resolvePath(routePath) {
) )
" "
> >
<span v-if="layout === 'horizontal'">
{{ transformI18n(props.item.meta.title) }}
</span>
<el-tooltip <el-tooltip
v-if="layout !== 'horizontal'" v-if="layout !== 'horizontal'"
placement="top" placement="top"

View File

@ -65,7 +65,7 @@ const dynamicTagView = () => {
moveToView(index); moveToView(index);
}; };
const moveToView = (index: number): void => { const moveToView = async (index: number): Promise<void> => {
const tabNavPadding = 10; const tabNavPadding = 10;
if (!instance.refs["dynamic" + index]) return; if (!instance.refs["dynamic" + index]) return;
const tabItemEl = instance.refs["dynamic" + index][0]; const tabItemEl = instance.refs["dynamic" + index][0];
@ -75,8 +75,13 @@ const moveToView = (index: number): void => {
const scrollbarDomWidth = scrollbarDom.value const scrollbarDomWidth = scrollbarDom.value
? scrollbarDom.value?.offsetWidth ? scrollbarDom.value?.offsetWidth
: 0; : 0;
// dom
await nextTick();
// //
const tabDomWidth = tabDom.value ? tabDom.value?.offsetWidth : 0; const tabDomWidth = tabDom.value ? tabDom.value?.offsetWidth : 0;
scrollbarDomWidth <= tabDomWidth scrollbarDomWidth <= tabDomWidth
? (isShowArrow.value = true) ? (isShowArrow.value = true)
: (isShowArrow.value = false); : (isShowArrow.value = false);
@ -188,6 +193,7 @@ function deleteDynamicTag(obj: any, current: any, tag?: string) {
): void => { ): void => {
if (other) { if (other) {
useMultiTagsStoreHook().handleTags("equal", [routerArrays[0], obj]); useMultiTagsStoreHook().handleTags("equal", [routerArrays[0], obj]);
dynamicTagView();
} else { } else {
delAliveRouteList = useMultiTagsStoreHook().handleTags("splice", "", { delAliveRouteList = useMultiTagsStoreHook().handleTags("splice", "", {
startIndex, startIndex,