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

不开启下拉刷新 H5 端onReady与useReady不执行 #12406

Closed
Youngwellcool opened this issue Aug 30, 2022 · 3 comments
Closed

不开启下拉刷新 H5 端onReady与useReady不执行 #12406

Youngwellcool opened this issue Aug 30, 2022 · 3 comments
Labels
question Further information is requested T-h5 Target - 编译到 H5

Comments

@Youngwellcool
Copy link

Youngwellcool commented Aug 30, 2022

相关平台

H5

浏览器版本: Chrome 版本 104.0.5112.102(正式版本)
使用框架: Vue 3

复现步骤

  props: {},
  onReady() {
    console.log("onReady");  // 不开启下拉刷新 H5 端不执行
  },
  onShow() {
    console.log("onShow");
    console.log(new Date().getTime());
  },
  onLoad(options) {
    console.log("onLoad");
    console.log(options);
  },
  onHide() {
    console.log("onHide");
  },
  onPullDownRefresh() {
    console.log("onPullDownRefresh ");
  },
  onReachBottom() {
    console.log("onReachBottom");
  },
  onPageScroll() {
    console.log("onPageScroll");
  },
  setup() {
    Taro.useReady(() => {
      console.log("useReady");  // 不开启下拉刷新 H5 端不执行
      console.log(new Date().getTime());
    });
    Taro.useDidShow(() => {
      console.log("useDidShow");
      console.log(new Date().getTime());
    });
    Taro.useDidHide(() => {
      console.log("useDidHide");
    });
    Taro.usePullDownRefresh(() => {
      console.log("usePullDownRefresh");
    });
    Taro.useReachBottom(() => {
      console.log("useReachBottom");
    });
    Taro.usePageScroll((res) => {
      console.log("usePageScroll");
    });
  },
};

期望结果

不开启下拉刷新 H5 端onReady与useReady要执行

实际结果

不开启下拉刷新 H5 端onReady与useReady不执行

环境信息

  Taro CLI 3.5.2 environment info:
    System:
      OS: Windows 10
    Binaries:
      Node: 12.1.0 - C:\Program Files\nodejs\node.EXE
      Yarn: 1.22.17 - C:\Users\EDY\AppData\Roaming\npm\yarn.CMD
      npm: 6.9.0 - C:\Program Files\nodejs\npm.CMD
@ZakaryCode
Copy link
Contributor

未能复现到该问题

@ZakaryCode ZakaryCode added question Further information is requested to be closed labels Sep 21, 2022
@Youngwellcool
Copy link
Author

Youngwellcool commented Sep 21, 2022 via email

@Youngwellcool
Copy link
Author

<script> import Taro from '@tarojs/taro' import { defineComponent, onMounted } from 'vue' definePageConfig({ navigationBarTitleText: '首页', navigationBarTextStyle: 'white', navigationBarBackgroundColor: '#3FE01F', disableScroll: false, enablePullDownRefresh: true, backgroundTextStyle: 'dark', enableShareAppMessage: true, enableShareTimeline: true }) export default defineComponent({ props: {}, onReady() { console.log('onReady') // 不开启下拉刷新 H5 端不执行 }, onShow() { console.log('onShow') console.log(new Date().getTime()) }, onLoad(options) { console.log('onLoad') console.log(options) }, onHide() { console.log('onHide') }, onPullDownRefresh() { console.log('onPullDownRefresh ') }, onReachBottom() { console.log('onReachBottom') }, onPageScroll() { console.log('onPageScroll') }, setup() { Taro.useDidShow(() => { console.log('useDidShow') console.log(new Date().getTime()) }) onMounted(() => { console.log('onMounted') console.log(document.querySelector('.div')) }) Taro.useReady(() => { console.log('useReady') // 不开启下拉刷新 H5 端不执行 console.log(new Date().getTime()) }) Taro.useDidHide(() => { console.log('useDidHide') }) Taro.usePullDownRefresh(() => { console.log('usePullDownRefresh') }) Taro.useReachBottom(() => { console.log('useReachBottom') }) Taro.usePageScroll((res) => { console.log('usePageScroll') }) } }) </script>

把这vue代码复制到Taro工程中,run dev:h5 看下就知道有不有这问题了

@ZakaryCode ZakaryCode moved this to Done in H5 Apr 10, 2023
@ZakaryCode ZakaryCode added this to H5 Apr 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested T-h5 Target - 编译到 H5
Projects
Archived in project
Development

No branches or pull requests

2 participants