mirror of
https://gitee.com/yiming_chang/vue-pure-admin.git
synced 2024-11-29 17:57:37 +08:00
fix: 修复配置路由属性fixedTag
为false
后当前标签页不可关闭的问题
This commit is contained in:
parent
933ced4ac4
commit
47afa9209e
@ -37,6 +37,7 @@ const {
|
||||
buttonLeft,
|
||||
showModel,
|
||||
translateX,
|
||||
isFixedTag,
|
||||
pureSetting,
|
||||
activeIndex,
|
||||
getTabStyle,
|
||||
@ -578,7 +579,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)"
|
||||
@ -593,10 +594,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)"
|
||||
@ -617,7 +618,7 @@ onBeforeUnmount(() => {
|
||||
{{ transformI18n(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)"
|
||||
>
|
||||
|
@ -125,6 +125,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;
|
||||
@ -221,6 +227,7 @@ export function useTags() {
|
||||
buttonTop,
|
||||
buttonLeft,
|
||||
translateX,
|
||||
isFixedTag,
|
||||
pureSetting,
|
||||
activeIndex,
|
||||
getTabStyle,
|
||||
|
Loading…
Reference in New Issue
Block a user