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

vue3中onshow无法直接访问this中的属性 #7771

Closed
yangthen opened this issue Sep 30, 2020 · 0 comments · Fixed by #7836
Closed

vue3中onshow无法直接访问this中的属性 #7771

yangthen opened this issue Sep 30, 2020 · 0 comments · Fixed by #7836
Labels
F-vue3 Framework - Vue 3 T-weapp Target - 编译到微信小程序 V-3 Version - 3.x
Milestone

Comments

@yangthen
Copy link

yangthen commented Sep 30, 2020

相关平台

微信小程序

复现仓库

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
@taro-bot2 taro-bot2 bot added F-vue3 Framework - Vue 3 T-weapp Target - 编译到微信小程序 V-3 Version - 3.x labels Sep 30, 2020
@yangthen yangthen changed the title vue3中onshow无法直接访问this中定义的属性 vue3中onshow无法直接访问this中的属性 Sep 30, 2020
@Chen-jj Chen-jj added this to the 3.0.15 milestone Oct 14, 2020
luckyadam added a commit that referenced this issue Oct 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F-vue3 Framework - Vue 3 T-weapp Target - 编译到微信小程序 V-3 Version - 3.x
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants