fix:取消重复方法

This commit is contained in:
piexlmax(奇淼
2024-02-29 16:34:08 +08:00
parent a23fb627cd
commit 96919a9f79
@@ -10,9 +10,9 @@
>
<el-tab-pane
v-for="item in historys"
:key="name(item)"
:key="getFmtString(item)"
:label="item.meta.title"
:name="name(item)"
:name="getFmtString(item)"
:tab="item"
class="gva-tab"
>
@@ -20,13 +20,13 @@
<span
:tab="item"
:style="{
color: activeValue === name(item) ? userStore.activeColor : '#333',
color: activeValue === getFmtString(item) ? userStore.activeColor : '#333',
}"
><i
class="dot"
:style="{
backgroundColor:
activeValue === name(item) ? userStore.activeColor : '#ddd',
activeValue === getFmtString(item) ? userStore.activeColor : '#ddd',
}"
/>
{{ fmtTitle(item.meta.title,item) }}</span>
@@ -48,7 +48,6 @@
</div>
</template>
<script setup>
import { emitter } from '@/utils/bus.js'
import { computed, onUnmounted, ref, watch } from 'vue'
@@ -73,12 +72,6 @@ const contextMenuVisible = ref(false)
const userStore = useUserStore()
const name = (item) => {
return (
item.name + JSON.stringify(item.query) + JSON.stringify(item.params)
)
}
const left = ref(0)
const top = ref(0)
const isCollapse = ref(false)
@@ -280,7 +273,7 @@ watch(() => historys.value, () => {
const initPage = () => {
// 全局监听 关闭当前页面函数
emitter.on('closeThisPage', () => {
removeTab(name(route))
removeTab(getFmtString(route))
})
// 全局监听 关闭所有页面函数
emitter.on('closeAllPage', () => {