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

基座下跳转不同的嵌套了子应用的页面,在返回上一页时会地址栏展示不正确,导致渲染错误 #941

Open
hengwuming opened this issue Oct 27, 2023 · 7 comments
Labels
feature Planned functions TODO

Comments

@hengwuming
Copy link

hengwuming commented Oct 27, 2023

问题描述

问题的具体描述
基座下跳转不同的嵌套了子应用的页面,在返回上一页时会地址栏展示不正确,导致渲染错误

复现步骤

1.基座下存在a,b两个页面,b页面存在一个按钮,点击事件为this.$router.back(),均嵌套了子应用
2.在a页面跳转到b页面时,在页面内容加载时,一直点击b页面的按钮,能回退到a页面,但是地址栏会在进入一瞬间展示正确的地址,然后变成b页面的地址,此时需要将子应用延迟加载,否则会正常渲染。在a页面打印this.$route.path为a的地址,但是地址显示为b的地址。
3.在所有生命周期钩子打印,均正常执行,error钩子未执行

上传截图

请上传代码截图、控制台、终端等截图以帮助我们了解您的问题。

复现仓库

请提供一个精简的代码仓库,然后上传到自己的 github,以帮助我们复现您的问题。

环境信息

  • micro-app版本:0.8.11
  • 主应用前端框架&版本:vue 2.6.11
  • 子应用前端框架&版本:vue 2.6.11
  • 构建工具&版本:webpack 4.46.0
@bailicangdu bailicangdu added common common question router Need Reproduction 需要复现步骤 labels Oct 27, 2023
@github-actions
Copy link

Hello @hengwuming. In order to facilitate location and troubleshooting, we need you to provide a realistic GitHub repository.
您好 @hengwuming, 为了方便定位和排查问题,我们需要您提供一个重现实例,请提供一个尽可能精简的 GitHub 仓库地址。

@bailicangdu
Copy link
Contributor

理论上存在这种可能,能提供个复现的demo吗

@bailicangdu bailicangdu removed the common common question label Oct 27, 2023
@hengwuming
Copy link
Author

理论上存在这种可能,能提供个复现的demo吗

好的,晚上下班了,我尝试写个demo能不能复现

@hengwuming
Copy link
Author

理论上存在这种可能,能提供个复现的demo吗
抱歉,我在我的demo中不能复现, 但是我写了一下公司代码中的逻辑,大概就是a页面跳转到b页面,跳转时携带一个id,b页面通过id去请求接口获取配置然后渲染对应的子应用,这是demo地址:https://github.com/hengwuming/micdemo

@github-actions github-actions bot closed this as completed Nov 6, 2023
Copy link

github-actions bot commented Nov 6, 2023

Since the issue was labeled with Need Reproduction, but no response in 7 days. This issue will be close. If you have any questions, you can comment and reply.
由于该 issue 被标记为需要可复现步骤,却 7 天未收到回应。现关闭 issue,若有任何问题,可评论回复。

@hengwuming
Copy link
Author

hengwuming commented Nov 13, 2023

理论上存在这种可能,能提供个复现的demo吗

有个报错忘记贴了,抱歉抱歉

index.js:1 [micro-app] app sub-xxxx-xxxxx: an error occurred in the unmount function
TypeError: q is not a function
at e.unmount (eval at runCode2Function (index.esm.js:1:1), :23:33226)
at CreateApp.y [as umdHookUnmount] (eval at runCode2Function (index.esm.js:1:1), :3:3840)
at CreateApp.unmount (index.esm.js:3072:1)
at MicroAppElement.handleUnmount (index.esm.js:3459:1)
at MicroAppElement.disconnectedCallback (index.esm.js:3271:1)
at HTMLDivElement.removeChild (index.esm.js:1167:1)
at Object.removeChild (vue.min.js:6:41102)
at l (vue.min.js:6:56312)
at n (vue.min.js:6:58423)
at w (vue.min.js:6:58602)

@bailicangdu bailicangdu removed the Need Reproduction 需要复现步骤 label Nov 13, 2023
@bailicangdu
Copy link
Contributor

bailicangdu commented Nov 13, 2023

目前子应用一旦渲染是不可暂停的,但确实存在渲染到一半被卸载的情况,对于这个问题我们会进行修复

@bailicangdu bailicangdu reopened this Nov 13, 2023
@bailicangdu bailicangdu added feature Planned functions TODO and removed router labels Nov 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Planned functions TODO
Projects
None yet
Development

No branches or pull requests

2 participants