react-vant icon indicating copy to clipboard operation
react-vant copied to clipboard

🐛 [Bug]: SwipeCell组件禁止滑动失效

Open zhuaoshuai13 opened this issue 10 months ago • 0 comments

Which React Vant packages are impacted?

  • [x] react-vant (React Vant core)
  • [ ] react-vant-icons(React Vant Icon)

What version of React Vant are you using?

3.3.5

Reproduce live demo(codesandebox or stackblitz)?

No response

Descripition

刚开始可以滑动

  1. 如果此时不进行任何操作,直接点击按钮切换禁止状态,SwipeCell可以根据期望紧张滑动。
  2. 如何此时去操作SwipeCell进行滑动操作,然后点击按钮切换禁止状态,可以发现SwipeCell依旧可以滑动

"use client" import { useState } from "react"

import { SwipeCell, Button, Cell, Toast } from "react-vant"

const page = () => { const [disabled, setDisabled] = useState(false) return (

<SwipeCell disabled={disabled} onOpen={() => Toast.info("打开")} onClose={() => Toast.info("关闭")} rightAction={ <Button style={{ height: "100%" }} square type='danger'> 删除 </Button> } > <Cell title='单元格' value='内容' /> </SwipeCell> <Button onClick={() => { setDisabled(!disabled) }} > {!disabled ? "点击禁止" : "点击允许"} </Button>
) }

export default page

zhuaoshuai13 avatar Feb 27 '25 02:02 zhuaoshuai13