Vue2 组件onShow 事件怎么触发 #14786
juliazz
started this conversation in
Feature Request
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
微信小程序
小程序基础库: 2.26.0
使用框架: Vue 2
复现步骤:
页面调用 navigateBack时,返回页面的组件中的OnShow未触发
组件代码:
`
mounted(options){
eventCenter.once(getCurrentInstance().router.onShow, () => {
console.log('eventCenter.once onShow page_view_start')
this.onPageShow()
})
},
beforeDestroy() {
eventCenter.off(getCurrentInstance().router.onShow);
},
`
环境信息:
👽 Taro v3.4.8
Browserslist: caniuse-lite is outdated. Please run:
npx update-browserslist-db@latest
Why you should do it regularly: https://github.com/browserslist/update-db#readme
Taro CLI 3.4.8 environment info:
System:
OS: macOS 13.5
Shell: 5.9 - /bin/zsh
Binaries:
Node: 16.14.0 - /usr/local/bin/node
Yarn: 1.22.19 - /usr/local/bin/yarn
npm: 8.3.1 - /usr/local/bin/npm
npmPackages:
@tarojs/components: 3.6.8 => 3.6.8
@tarojs/mini-runner: 3.6.8 => 3.6.8
@tarojs/runtime: 3.6.8 => 3.6.8
@tarojs/taro: 3.6.8 => 3.6.8
@tarojs/webpack-runner: 3.6.1 => 3.6.1
babel-preset-taro: 3.6.18 => 3.4.8
eslint-config-taro: 3.4.8 => 3.4.8
Beta Was this translation helpful? Give feedback.
All reactions