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

createComponentWrapper 导致beforeRouteEnter 第一次无法获取到实例暴露的函数 #464

Open
xiongzh120 opened this issue Jul 2, 2024 · 3 comments

Comments

@xiongzh120
Copy link

Snipaste_2024-07-02_10-15-12 Snipaste_2024-07-02_10-17-38 无法获取到第一次进入页面的实例方法getInfo Snipaste_2024-07-02_10-16-09 Snipaste_2024-07-02_10-20-10 注释name后,重新进入正常了(不是刷新页面),但是注释name会导致keep-alive(详情页以及多个路由共用同一个组件的情况)失效,
@xiongzh120
Copy link
Author

参考:vue3 使用beforeRouteEnter

@HalseySpicy
Copy link
Owner

那有办法解决吗

@xiongzh120
Copy link
Author

参考#445 dynamicRouter.ts 的 item.component = () => component().then((com: any) => ({ ...com.default, name: item.name }));解决的

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

No branches or pull requests

1 participant