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

Bug: 切换Tab不会隐藏抽屉 #5415

Closed
5 tasks done
sw-Fang opened this issue Jan 16, 2025 · 2 comments
Closed
5 tasks done

Bug: 切换Tab不会隐藏抽屉 #5415

sw-Fang opened this issue Jan 16, 2025 · 2 comments

Comments

@sw-Fang
Copy link

sw-Fang commented Jan 16, 2025

Version

Vben Admin V5

Describe the bug?

在内容区域打开的抽屉,切换Tab时不会隐藏抽屉。
Image

Image

Reproduction

新项目中,从Playground的examples/drawer目录中复制出来,也存在该问题。但是运行Playground项目是正常的。

System Info

System:
    OS: Windows 11 10.0.22631
    CPU: (16) x64 12th Gen Intel(R) Core(TM) i5-12600KF
    Memory: 32.08 GB / 63.84 GB
  Binaries:
    Node: 20.17.0 - D:\work\nodejs\node.EXE
    Yarn: 1.22.22 - D:\work\nodejs\yarn.CMD
    npm: 10.8.2 - D:\work\nodejs\npm.CMD
    pnpm: 9.14.4 - D:\work\nodejs\pnpm.CMD
  Browsers:
    Edge: Chromium (127.0.2651.74)
    Internet Explorer: 11.0.22621.3527

Relevant log output

Validations

@mynetfan
Copy link
Collaborator

onBeforeRouteLeave(() => {
  drawerApi.close();
});

在你的页面添加这几行代码。onBeforeRouteLeave从vue-router中导入,drawerApi换成你自己的drawer的api

@sw-Fang
Copy link
Author

sw-Fang commented Jan 17, 2025

onBeforeRouteLeave(() => {
  drawerApi.close();
});

在你的页面添加这几行代码。onBeforeRouteLeave从vue-router中导入,drawerApi换成你自己的drawer的api

添加了上述代码后可以解决该问题。

@sw-Fang sw-Fang closed this as completed Jan 17, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Feb 1, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants