mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2024-12-21 04:50:14 +08:00
fix(carousel): fix navigate to current item (#302)
* fix(carousel): fix carousel click triggering button bug * Apply suggestions from code review Co-authored-by: 07akioni <07akioni2@gmail.com>
This commit is contained in:
parent
4401d4954f
commit
3d48a7c711
@ -16,6 +16,7 @@
|
||||
|
||||
- Fix `n-date-picker` `n-provider` pass `date-locale` not work, closes [#250](https://github.com/TuSimple/naive-ui/issues/250).
|
||||
- Fix `n-input` clear button placeholder prevent clicking on actual component [#288](https://github.com/TuSimple/naive-ui/issues/288)
|
||||
- Fix `n-carousel` click the at current item button, the component behaves abnormally.
|
||||
|
||||
## 2.14.0 (2021-06-23)
|
||||
|
||||
|
@ -16,6 +16,7 @@
|
||||
|
||||
- 修复 `n-date-picker` `n-provider` 传递 `date-locale` 属性无效,关闭 [#250](https://github.com/TuSimple/naive-ui/issues/250)
|
||||
- Fix `n-input` clear button placeholder prevent clicking on actual component [#288](https://github.com/TuSimple/naive-ui/issues/288)
|
||||
- 修复 `n-carousel` 点击当前页对应的控制按钮时,组件显示异常
|
||||
|
||||
## 2.14.0 (2021-06-23)
|
||||
|
||||
|
@ -60,8 +60,9 @@ export default defineComponent({
|
||||
function setCurrent (value: number): void {
|
||||
if (lengthRef.value <= 1) return
|
||||
if (inTransition) return
|
||||
inTransition = true
|
||||
const { value: current } = currentRef
|
||||
if (value === current) return
|
||||
inTransition = true
|
||||
if (current === 1 && value === lengthRef.value && value - current > 1) {
|
||||
currentRef.value--
|
||||
} else if (
|
||||
|
Loading…
Reference in New Issue
Block a user