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端的Taro. pageScrollTo()不生效且控制台抛出错误 #8036

Closed
JoeYnnn opened this issue Nov 15, 2020 · 1 comment
Closed

H5端的Taro. pageScrollTo()不生效且控制台抛出错误 #8036

JoeYnnn opened this issue Nov 15, 2020 · 1 comment
Labels
F-react Framework - React T-h5 Target - 编译到 H5 V-3 Version - 3.x

Comments

@JoeYnnn
Copy link

JoeYnnn commented Nov 15, 2020

相关平台

H5

浏览器版本: Chrome 86.0.4240.193****小程序基础库: H5
使用框架: React

复现步骤

Taro.pageScrollTo({
      selector: `#${anchorName}`,
      duration: 300,
      success: key => {
        console.log(key);
      },
      fail: err => {
        console.log(err);
      },
      complete: res => {
        console.log(res);
      },
    });

文档内写的pageScrollTo不是必填项,但是控制台抛出必填说明,填写了pageScrollTo也不会跳转

期望结果

页面进入跳转到对应id容器的位置

实际结果

Uncaught (in promise) {errMsg: "pageScrollTo:fail "scrollTop" is required"}

环境信息

Taro CLI 3.0.16 environment info:
    System:
      OS: macOS 11.0.1
      Shell: 5.8 - /bin/zsh
    Binaries:
      Node: 10.16.0 - /usr/local/bin/node
      Yarn: 1.17.3 - /usr/local/bin/yarn
      npm: 6.9.0 - /usr/local/bin/npm
    npmPackages:
      @tarojs/cli: 3.0.16 => 3.0.16
      @tarojs/components: 3.0.16 => 3.0.16
      @tarojs/mini-runner: 3.0.16 => 3.0.16
      @tarojs/react: 3.0.16 => 3.0.16
      @tarojs/runtime: 3.0.16 => 3.0.16
      @tarojs/taro: 3.0.16 => 3.0.16
      @tarojs/webpack-runner: 3.0.16 => 3.0.16
      babel-preset-taro: 3.0.16 => 3.0.16
      eslint-config-taro: 3.0.16 => 3.0.16
      react: ^16.10.0 => 16.14.0
      taro-ui: ^3.0.0-alpha.3 => 3.0.0-alpha.3
@Chen-jj
Copy link
Contributor

Chen-jj commented Jan 27, 2021

上述中 PR 已修复,3.0.19+ 生效

@Chen-jj Chen-jj closed this as completed Jan 27, 2021
@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
F-react Framework - React T-h5 Target - 编译到 H5 V-3 Version - 3.x
Projects
Archived in project
Development

No branches or pull requests

2 participants