Skip to content

Tab点击TabItem报错 Cannot read property 'requestAnimationFrame' of undefined #784

Description

@leoskey

这个 Issue 涉及以下平台:

  • 微信小程序
  • 支付宝小程序
  • 百度小程序
  • 头条小程序
  • 快手小程序
  • QQ 轻应用
  • Web 平台(H5)

BUG 描述
Tab点击TabItem报错 Cannot read property 'requestAnimationFrame' of undefined,onChange不生效

复现步骤

// 页面代码
import { Tab, Tabs } from "@antmjs/vantui";

const tabs = [
  {
    title: "全部",
    name: ""
  }, {
    title: "待支付",
    name: "1"
  }, {
    title: "已完成",
    name: "9"
  }, {
    title: "售后",
    name: "11"
  }
];

export default function Index(){
  return (
    <>
      <Tabs sticky ellipsis={false} onChange={console.log}>
        {tabs.map((item, index) => (
          <Tab key={index} title={item.title} name={item.name} />
        ))}
      </Tabs>
    </>
  );
}

期望结果
onChange 正常执行

实际结果
onChange 不执行执行

截图

Image

环境
"@tarojs/taro": "4.1.5"
"@antmjs/vantui": "3.4.8"

附加信息
异常对应源代码

if (window.requestAnimationFrame) {

源代码提交时间
d45ebbd#diff-83b5a7c35b364eec9136c93a85d1960fa360f68228803069934cd59285ff78d4R45-R46

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions