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

小程序关闭后,再扫码进入显示空白 #8103

Closed
lmm1990 opened this issue Nov 23, 2020 · 6 comments · Fixed by #8259
Closed

小程序关闭后,再扫码进入显示空白 #8103

lmm1990 opened this issue Nov 23, 2020 · 6 comments · Fixed by #8259
Assignees
Labels
F-vue3 Framework - Vue 3 P-1 High, patch T-weapp Target - 编译到微信小程序 V-3 Version - 3.x
Milestone

Comments

@lmm1990
Copy link

lmm1990 commented Nov 23, 2020

相关平台

微信小程序

复现仓库

https://github.com/lmm1990/taro-bug-test
小程序基础库: 未设置
使用框架: Vue 3

复现步骤

1、项目运行后微信开发者工具-》预览-》二维码预览
2、手机扫码打开小程序-》点击小程序关闭按钮
3、再扫码进入小程序,显示空白

期望结果

应该显示第一次扫码进入小程序的内容

实际结果

显示空白

环境信息

Taro CLI 3.0.17 environment info:
    System:
      OS: Windows 10
    Binaries:
      Node: 15.2.1 - C:\Program Files\nodejs\node.EXE
      Yarn: 1.22.5 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
      npm: 7.0.8 - C:\Program Files\nodejs\npm.CMD

@taro-bot2 taro-bot2 bot added F-vue3 Framework - Vue 3 T-weapp Target - 编译到微信小程序 V-3 Version - 3.x labels Nov 23, 2020
@lmm1990
Copy link
Author

lmm1990 commented Nov 23, 2020

预览第一次扫码
image
显示正常:
image

@lmm1990
Copy link
Author

lmm1990 commented Nov 23, 2020

点击小程序关闭按钮:
image
再次扫码后显示空白:
image
image

@lmm1990
Copy link
Author

lmm1990 commented Nov 25, 2020

经调试【编译后dist目录】,第一次打开小程序后
taro.js 中
key: "performUpdate",
value: function performUpdate() {
_this13.updatePayloads变量值为: [{"path":"root.cn.[0]"},{"path":"root.uid","value":"pages/index/index"},{"path":"root.cl","value":""}]

第二次打开,_this13.updatePayloads变量值为: []

@Chen-jj Chen-jj added the P-1 High, patch label Nov 27, 2020
@taro-bot2 taro-bot2 bot added this to the 3.0.18 milestone Nov 27, 2020
@Chen-jj Chen-jj modified the milestones: 3.0.18, 3.0.19 Dec 4, 2020
Chen-jj added a commit that referenced this issue Dec 14, 2020
在开发环境重新扫码,或分享后再次打开,这是小程序不会重复触发 onLaunch 完全重启整个小程序。

必须等页面都卸载后再加载新页面,否则 Taro DOM 树卸载失败,此时 web 框架判断旧 DOM 树结构和新树对比没有变化,就不再挂载,导致没有 setData,从而白屏。
@Chen-jj Chen-jj linked a pull request Dec 14, 2020 that will close this issue
9 tasks
Chen-jj added a commit that referenced this issue Dec 15, 2020
在开发环境重新扫码,或分享后再次打开,这是小程序不会重复触发 onLaunch 完全重启整个小程序。

必须等页面都卸载后再加载新页面,否则 Taro DOM 树卸载失败,此时 web 框架判断旧 DOM 树结构和新树对比没有变化,就不再挂载,导致没有 setData,从而白屏。
@mokinzhao
Copy link

解决了吗?啥时候有更新包

@lmm1990
Copy link
Author

lmm1990 commented Dec 17, 2020

等下个版本发布

@mokinzhao
Copy link

我降级到vue2.x为何就可以了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F-vue3 Framework - Vue 3 P-1 High, patch T-weapp Target - 编译到微信小程序 V-3 Version - 3.x
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants