mirror of
				https://github.com/pure-admin/vue-pure-admin.git
				synced 2025-11-03 13:44:47 +08:00 
			
		
		
		
	Merge branch 'main' into gitee
This commit is contained in:
		
						commit
						534d125c33
					
				@ -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"
 | 
			
		||||
        >
 | 
			
		||||
          <div
 | 
			
		||||
            ref="titleRef"
 | 
			
		||||
 | 
			
		||||
@ -274,6 +274,9 @@ function resolvePath(routePath) {
 | 
			
		||||
          :is="useRenderIcon(props.item.meta && toRaw(props.item.meta.icon))"
 | 
			
		||||
        />
 | 
			
		||||
      </div>
 | 
			
		||||
      <span v-if="layout === 'horizontal'">
 | 
			
		||||
        {{ transformI18n(props.item.meta.title) }}
 | 
			
		||||
      </span>
 | 
			
		||||
      <div
 | 
			
		||||
        :style="getSubMenuDivStyle(props.item)"
 | 
			
		||||
        v-if="
 | 
			
		||||
@ -284,9 +287,6 @@ function resolvePath(routePath) {
 | 
			
		||||
          )
 | 
			
		||||
        "
 | 
			
		||||
      >
 | 
			
		||||
        <span v-if="layout === 'horizontal'">
 | 
			
		||||
          {{ transformI18n(props.item.meta.title) }}
 | 
			
		||||
        </span>
 | 
			
		||||
        <el-tooltip
 | 
			
		||||
          v-if="layout !== 'horizontal'"
 | 
			
		||||
          placement="top"
 | 
			
		||||
 | 
			
		||||
@ -65,7 +65,7 @@ const dynamicTagView = () => {
 | 
			
		||||
  moveToView(index);
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
const moveToView = (index: number): void => {
 | 
			
		||||
const moveToView = async (index: number): Promise<void> => {
 | 
			
		||||
  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,
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user