Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Component] [carousel] 在 onMounted 中执行翻页操作失效 #13010

Closed
SaberA1ter opened this issue May 30, 2023 · 0 comments · Fixed by #13011
Closed

[Component] [carousel] 在 onMounted 中执行翻页操作失效 #13010

SaberA1ter opened this issue May 30, 2023 · 0 comments · Fixed by #13011
Labels

Comments

@SaberA1ter
Copy link
Contributor

Bug Type: Component

Environment

  • Vue Version: 3.3.4
  • Element Plus Version: 2.3.5
  • Browser / OS: Chrome/113.0.5672.127
  • Build Tool: Vite

Reproduction

Related Component

  • el-carousel

Reproduction Link

Element Plus Playground

Steps to reproduce

在最小复现中进入页面时可见

  // 执行代码
  onMounted(() => {
    console.log('next!!!')
    instance.value.next()
  })

What is Expected?

初始页默认 1,按照正常理解,翻页之后应该是 2

What is actually happening?

页数仍为 1

Additional comments

尽管可以使用 nextTick 去避免这个问题,但是页面会有非常明显的一个翻页过渡效果,这并非是我所期望的效果

HeftyKoo pushed a commit that referenced this issue Sep 16, 2023
…13011)

* fix(components): [carousel] Watch items causing state loss(#13010)

* perf(components): [carousel] Using the third parameter of watch(#13010)

---------

Co-authored-by: ZZQChongYa <zhengziqiang@star-net.cn>
@element-bot element-bot mentioned this issue Oct 13, 2023
3 tasks
consultation-applio pushed a commit to consultation-applio/element-plus that referenced this issue Nov 10, 2023
…us#13010) (element-plus#13011)

* fix(components): [carousel] Watch items causing state loss(element-plus#13010)

* perf(components): [carousel] Using the third parameter of watch(element-plus#13010)

---------

Co-authored-by: ZZQChongYa <zhengziqiang@star-net.cn>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant