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(projects): fix:tab切换路由fullpath #78

Closed
wants to merge 1 commit into from

Conversation

baiye0
Copy link

@baiye0 baiye0 commented Apr 22, 2022

支持tab页切换路由参数保留

ISSUES CLOSED: #64

支持tab页切换路由参数保留

ISSUES CLOSED: soybeanjs#64
@vercel
Copy link

vercel bot commented Apr 22, 2022

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/honghuangdc/soybean-admin/2PevLxNTeMvP7PiJ34hvKcxTPsWE
✅ Preview: https://soybean-admin-git-fork-baiye0-main-honghuangdc.vercel.app

@@ -9,6 +9,7 @@ export function getTabRouteByVueRoute(route: RouteRecordNormalized | RouteLocati
name: route.name,
path: route.path,
meta: route.meta,
fullPath: (<RouteLocationNormalizedLoaded>route).fullPath,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里不要类型断言,参数route的类型需要重新定义

@@ -13,17 +13,9 @@ declare module 'vue' {
IconAntDesignCloseOutlined: typeof import('~icons/ant-design/close-outlined')['default']
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

components.d.ts这个文件不要修改

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不知道为啥变调了,提交的时候没注意...

const { routerPush } = useRouterPush(false);

const isActive = this.activeTab === path;
const isActive = this.activeTab === route.path;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里会不会有个问题,如果是同一个页面,但是params或者query参数不一致,页面是如何显示在Tab上的

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

应该是以fullpath为主,有参数和没参数的各起一个tab?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个还得用页面测试一下

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

常用的业务场景就是查看一个表格的某行的详情信息,可以开不同的详情页面

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

好的,我继续改一下。

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

常用的业务场景就是查看一个表格的某行的详情信息,可以开不同的详情页面

那这里的设计是每个不一样的参数都起一个tab呢,还是同一个path就起一个tab

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不一样的参数不同tab

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我这两天会添加这个功能

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

多页签切换点击无法保存路由中的query参数
2 participants