We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
微信小程序
https://github.com/pecopeco/taro-test 小程序基础库: 2.13.1 使用框架: Vue 3
在vue3中使用options模板语法,其他生命周期都正常,只有在生命周期onshow中,用this访问data或者methods中的内容,会报错为undefined,打印出this,将看到只能访问到$options属性 且在tabbar页面和其他页面表现不一致,在tabbar页面中,只有第一次进入页面无法访问this中的属性,第二次进入恢复正常,其余页面任何情况都是undefined
onshow中可以使用this
无法访问this中的内容
� Taro v3.0.13 Taro CLI 3.0.13 environment info: System: OS: Windows 10 Binaries: Node: 14.11.0 - C:\Program Files\nodejs\node.EXE npm: 6.14.8 - C:\Program Files\nodejs\npm.CMD
The text was updated successfully, but these errors were encountered:
fix(runtime): 修复 Vue3 onShow 触发时机,fix #7771
f879cf9
fix(runtime): 修复 Vue3 onShow 触发时机,fix #7771 (#7836)
2df4d87
Co-authored-by: Li,Weitao <[email protected]>
Successfully merging a pull request may close this issue.
相关平台
微信小程序
复现仓库
https://github.com/pecopeco/taro-test
小程序基础库: 2.13.1
使用框架: Vue 3
复现步骤
在vue3中使用options模板语法,其他生命周期都正常,只有在生命周期onshow中,用this访问data或者methods中的内容,会报错为undefined,打印出this,将看到只能访问到$options属性
且在tabbar页面和其他页面表现不一致,在tabbar页面中,只有第一次进入页面无法访问this中的属性,第二次进入恢复正常,其余页面任何情况都是undefined
期望结果
onshow中可以使用this
实际结果
无法访问this中的内容
环境信息
The text was updated successfully, but these errors were encountered: