AntmJS/vantui

Tabs组件支付宝小程序点击报错

Closed this issue · 0 comments

这个 Issue 涉及以下平台:

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

BUG 描述

Taro版本号:3.6.23
vantui版本号:3.3.3
文档中示例代码即复线:

<Tabs
      onDisabled={(e) =>
        Toast.show({
          message: e.detail.title + '已被禁',
          selector: '#tabs-demo4',
        })
      }
    >
      <Tab title="标签 1">内容 1</Tab>
      <Tab title="标签 2" disabled={true}>
        内容 2
      </Tab>
      <Tab title="标签 3">内容 3</Tab>
      <Toast id="tabs-demo4" />
   </Tabs>

复现步骤

运行点击tab按钮无法切换

期望结果

可以点击切换

实际结果

终端报错如下:

(index):1 TypeError: Cannot read properties of undefined (reading 'props')
    at TaroElement.onTap (VM83 index.worker.js:36581:19)
    at TaroElement.handler (VM83 index.worker.js:19518:31)
    at TaroElement.dispatchEvent (VM83 index.worker.js:20544:33)
    at VM83 index.worker.js:18392:16
    at exports.runWithPriority (VM83 index.worker.js:68638:25)
    at TaroHooks.<anonymous> (VM83 index.worker.js:18391:24)
    at TaroHooks.call (VM83 index.worker.js:25204:82)
    at dispatch (VM83 index.worker.js:21725:61)
    at VM83 index.worker.js:21739:15
    at exports.batchedUpdates (VM83 index.worker.js:68520:18)
e.executeFunctionAsync @ (index):1
(anonymous) @ (index):1
setTimeout (async)
e.setTimeout @ (index):1
e.setTimeout @ (index):1
setTimeout @ (index):1
onError @ index.worker.js?hash=4311953c&from_service_worker=true&url=file%3A%2F%2F%2Fhttp%3A%2F%2F127.0.0.1%3A51941%2Findex.html&page=pages%2Findex%2Findex&chInfo=ch_scan&ap_framework_sceneId=1011&enablePolyfillWorker=true&ap_framework_sceneId=1011:3
(anonymous) @ index.worker.js?hash=4311953c&from_service_worker=true&url=file%3A%2F%2F%2Fhttp%3A%2F%2F127.0.0.1%3A51941%2Findex.html&page=pages%2Findex%2Findex&chInfo=ch_scan&ap_framework_sceneId=1011&enablePolyfillWorker=true&ap_framework_sceneId=1011:3
C @ af-appx.worker.min.js:6
ko @ af-appx.worker.min.js:6
r.<computed> @ af-appx.worker.min.js:6
(anonymous) @ af-appx.worker.min.js:6
Wa @ af-appx.worker.min.js:6
e.reportMethodError @ af-appx.worker.min.js:6
e.invokePublicMethod @ af-appx.worker.min.js:6
(anonymous) @ af-appx.worker.min.js:6
e.wrapTapMark @ af-appx.worker.min.js:6
e.invokeHostTargetMethod @ af-appx.worker.min.js:6
e.onReceiveMethodCall @ af-appx.worker.min.js:6
e.onMessage @ af-appx.worker.min.js:6
e.executeFunctionAsync @ (index):1
e.handleMessageFromRender4MessagePort @ (index):1
e.handleMessage @ (index):1
t.postMessage2Host @ (index):1
e.postMessage2Host @ (index):1
e.handleAPI4PostMessage @ (index):1
e.bridgeCall @ (index):1
e.callBridgePluginAsyncInternal @ (index):1
(anonymous) @ (index):1
e.ensurePage @ (index):1
(anonymous) @ (index):1
setTimeout (async)
e.bridgeCall @ (index):1
t.invokeBridgeAsync @ (index):1
call @ (index):1
iu @ af-appx.min.js:6
pu @ af-appx.min.js:6
t.onPortMessage @ af-appx.min.js:6
t.postOppositeMessage @ af-appx.min.js:6
t.postMessage @ af-appx.min.js:6
t.invokeHostTargetMethod @ af-appx.min.js:6
t.invokeHostTargetMethod @ af-appx.min.js:6
t.callMethod @ af-appx.min.js:6
t.callHostReadyTargetMethod @ af-appx.min.js:6
Ls @ af-appx.min.js:6
t.invokeEventContext @ af-appx.min.js:6
(anonymous) @ af-appx.min.js:6
t.onEventHandler @ af-appx.min.js:6
Uh @ af-appx.min.js:6
jh @ af-appx.min.js:6
uf @ af-appx.min.js:6
hf @ af-appx.min.js:6
(anonymous) @ af-appx.min.js:6
vf @ af-appx.min.js:6
Dh @ af-appx.min.js:6
triggerTouch @ VM1731:195
(anonymous) @ VM1731:152

截图

环境

附加信息

初步排查原因为Tabs下的tab view的**data-index未能绑定成功**,导致取出dataset为undefined,直接使用taro的则可以从dataset中获取数据,后续没有深入继续排查~