使用版本 ---> "taro-ui": "^3.0.0-alpha.3"
界面效果:
image.png
使用AtSwipeAction不生效,官方文档书写不全,需要添加两个属性
1.maxDistance 滑块最大滑动距离,一般是按钮个数乘以按钮宽度
2.areaWidth 组件宽度 (如果不引用导致组件占位宽度为0,页面不显示)
<AtSwipeAction
maxDistance={80}
areaWidth={Taro.getSystemInfoSync().windowWidth * 0.88} // 适配不同手机系统屏幕宽度
autoClose
key={v.examineId}
options={[
{
text: '删除',
style: {
backgroundColor: '#FF4949',
width: '16px'
},
onClick: () => {
console.log(123)
}
}
]}
onClick={item => {
item.onClick && item.onClick();
}
}
>
<View className='card-items'>
...
</View>
</AtSwipeAction>
网友评论