chore: 同步完整版代码

This commit is contained in:
xiaoxian521 2024-06-13 12:17:24 +08:00
parent 036459cb02
commit 057fef9147
4 changed files with 17 additions and 6 deletions

View File

@ -36,6 +36,7 @@ const {
buttonLeft,
showModel,
translateX,
isFixedTag,
pureSetting,
activeIndex,
getTabStyle,
@ -576,7 +577,7 @@ onBeforeUnmount(() => {
'scroll-item is-closable',
linkIsActive(item),
showModel === 'chrome' && 'chrome-item',
!isAllEmpty(item?.meta?.fixedTag) && 'fixed-tag'
isFixedTag(item) && 'fixed-tag'
]"
@contextmenu.prevent="openMenu(item, $event)"
@mouseenter.prevent="onMouseenter(index)"
@ -591,10 +592,10 @@ onBeforeUnmount(() => {
</span>
<span
v-if="
isAllEmpty(item?.meta?.fixedTag)
? iconIsActive(item, index) ||
isFixedTag(item)
? false
: iconIsActive(item, index) ||
(index === activeIndex && index !== 0)
: false
"
class="el-icon-close"
@click.stop="deleteMenu(item)"
@ -615,7 +616,7 @@ onBeforeUnmount(() => {
{{ item.meta.title }}
</span>
<span
v-if="isAllEmpty(item?.meta?.fixedTag) ? index !== 0 : false"
v-if="isFixedTag(item) ? false : index !== 0"
class="chrome-close-btn"
@click.stop="deleteMenu(item)"
>

View File

@ -124,6 +124,12 @@ export function useTags() {
}
}
const isFixedTag = computed(() => {
return item => {
return isBoolean(item?.meta?.fixedTag) && item?.meta?.fixedTag === true;
};
});
const iconIsActive = computed(() => {
return (item, index) => {
if (index === 0) return;
@ -220,6 +226,7 @@ export function useTags() {
buttonTop,
buttonLeft,
translateX,
isFixedTag,
pureSetting,
activeIndex,
getTabStyle,

View File

@ -107,6 +107,7 @@ import {
ElWatermark,
ElTour,
ElTourStep,
ElSegmented,
/**
* 便 element-plus 使
* https://github.com/element-plus/element-plus/blob/dev/packages/element-plus/plugin.ts#L11-L16
@ -221,7 +222,8 @@ const components = [
ElUpload,
ElWatermark,
ElTour,
ElTourStep
ElTourStep,
ElSegmented
];
const plugins = [

View File

@ -115,6 +115,7 @@ declare module "vue" {
ElWatermark: (typeof import("element-plus"))["ElWatermark"];
ElTour: (typeof import("element-plus"))["ElTour"];
ElTourStep: (typeof import("element-plus"))["ElTourStep"];
ElSegmented: (typeof import("element-plus"))["ElSegmented"];
}
interface ComponentCustomProperties {