Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: the anchor and tabs conflict #5168

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/effects/layouts/src/authentication/form.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ defineOptions({
<KeepAlive :include="['Login']">
<component
:is="Component"
:key="route.fullPath"
:key="route.path"
class="enter-x mt-6 w-full sm:mx-auto md:max-w-md"
/>
</KeepAlive>
Expand Down
4 changes: 2 additions & 2 deletions packages/effects/layouts/src/basic/content/content.vue
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,13 @@ function transformComponent(
:is="transformComponent(Component, route)"
v-if="renderRouteView"
v-show="!route.meta.iframeSrc"
:key="route.fullPath"
:key="route.path"
/>
</KeepAlive>
<component
:is="Component"
v-else-if="renderRouteView"
:key="route.fullPath"
:key="route.path"
/>
</Transition>
</RouterView>
Expand Down
4 changes: 2 additions & 2 deletions packages/effects/layouts/src/basic/tabbar/use-tabbar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export function useTabbar() {
} = useTabs();

const currentActive = computed(() => {
return route.fullPath;
return route.path;
});

const { locale } = useI18n();
Expand Down Expand Up @@ -144,7 +144,7 @@ export function useTabbar() {
{
handler: async () => {
if (!contentIsMaximize.value) {
await router.push(tab.fullPath);
await router.push(tab.path);
}
toggleMaximize();
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ function showSpinning(index: number) {
</script>
<template>
<template v-if="showIframe">
<template v-for="(item, index) in iframeRoutes" :key="item.fullPath">
<template v-for="(item, index) in iframeRoutes" :key="item.path">
<div
v-if="canRender(item)"
v-show="routeShow(item)"
Expand Down
10 changes: 5 additions & 5 deletions packages/stores/src/modules/tabbar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ export const useTabbarStore = defineStore('core-tabbar', {
* @param tab
*/
_close(tab: TabDefinition) {
const { fullPath } = tab;
const { path } = tab;
if (isAffixTab(tab)) {
return;
}
const index = this.tabs.findIndex((item) => item.fullPath === fullPath);
const index = this.tabs.findIndex((item) => item.path === path);
index !== -1 && this.tabs.splice(index, 1);
},
/**
Expand Down Expand Up @@ -188,7 +188,7 @@ export const useTabbarStore = defineStore('core-tabbar', {
const paths: string[] = [];

for (const path of closePaths) {
if (path !== tab.fullPath) {
if (path !== tab.path) {
const closeTab = this.tabs.find((item) => getTabPath(item) === path);
if (!closeTab) {
continue;
Expand Down Expand Up @@ -290,7 +290,7 @@ export const useTabbarStore = defineStore('core-tabbar', {
* @param tab
*/
async openTabInNewWindow(tab: TabDefinition) {
openRouteInNewWindow(tab.fullPath || tab.path);
openRouteInNewWindow(tab.path);
},

/**
Expand Down Expand Up @@ -546,7 +546,7 @@ function isTabShown(tab: TabDefinition) {
* @param tab
*/
function getTabPath(tab: RouteRecordNormalized | TabDefinition) {
return decodeURIComponent((tab as TabDefinition).fullPath || tab.path);
return decodeURIComponent((tab as TabDefinition).path);
}

function routeToTab(route: RouteRecordNormalized) {
Expand Down
Loading