Skip to content

Commit

Permalink
fix: tab组件在支付宝小程序的问题(#618
Browse files Browse the repository at this point in the history
  • Loading branch information
kongjing committed Feb 21, 2024
1 parent 1f20e3b commit aa55120
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions packages/vantui/src/tabs/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,8 @@ export function Tabs(props: TabsProps) {
}
}

const onTap = function (event: any) {
let { index } = event.currentTarget.dataset
index = parseInt(index)
const onTap = function (index_) {
const index = parseInt(index_)
const child = newChildren[index]
if (child.props.disabled) {
trigger('onDisabled', child)
Expand Down Expand Up @@ -456,7 +455,7 @@ export function Tabs(props: TabsProps) {
swipeThreshold,
scrollable,
})}
onClick={onTap}
onClick={() => onTap(index)}
>
{/** tab bar */}
{type === 'line' && (
Expand Down

0 comments on commit aa55120

Please sign in to comment.