You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Click left arrow, and console will show that currentIndex has been changed to -2, and it cannot be changed or reseted.
点击向左切换图片,在控制台里可以看到currentIndex变成了-2,并且此时点击向左向右切换按钮都不能更改currentIndex
Expected results (期望的结果)
click left arrow, currentIndex cannot change(maybe it was -1 when there is only one image?)
Actual results (实际的结果)
click left arrow, currentIndex changed to -2, and cannot be changed.
Remarks (补充说明)
Maybe it is a good way to avoid this bug by:
When the number of images is one, hide the arrow by:
:show-arrow="images.length > 1"
:)
And the right arrow doesn't has this bug! Only the left one.
TuSimple/naive-ui version (版本)
2.34.3
Vue version (Vue 版本)
3.3.4
Browser and its version (浏览器及其版本)
Chrome(89.0.4389.128)
System and its version (系统及其版本)
MacOS(11.2.3)
Node version (Node 版本)
Reappearance link (重现链接)
https://codesandbox.io/embed/friendly-surf-7qlgzq?fontsize=14&hidenavigation=1&theme=dark
Reappearance steps (重现步骤)
Click left arrow, and console will show that currentIndex has been changed to -2, and it cannot be changed or reseted.
点击向左切换图片,在控制台里可以看到currentIndex变成了-2,并且此时点击向左向右切换按钮都不能更改currentIndex
Expected results (期望的结果)
click left arrow, currentIndex cannot change(maybe it was -1 when there is only one image?)
Actual results (实际的结果)
click left arrow, currentIndex changed to -2, and cannot be changed.
Remarks (补充说明)
Maybe it is a good way to avoid this bug by:
When the number of images is one, hide the arrow by:
:show-arrow="images.length > 1"
:)
And the right arrow doesn't has this bug! Only the left one.
我现在解决这个bug的方式是在carousel中引入 :show-arrow="images.length > 1" 去动态判断图片的数量来控制按钮的显隐,因为我觉得如果不点这个左侧切换按键就应该不会有这个bug。但是可能对于这种静态元素不太好用!
在一张图的时候点击右侧切换是不会有问题的,index也不会改变。
The text was updated successfully, but these errors were encountered: