question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[comp:Carousel] feature Carousel component

See original GitHub issue
  • I have searched the issues of this repository and believe that this is not a duplicate.

What problem does this feature solve?

走马灯,展示一组轮播的区域,常用于一组图片或卡片轮播

What does the proposed API look like?

API

参数 说明 类型 默认值 全局配置 备注
autoplayTime 自动播放的时间间隔,为 0 时不自动切换 number 0 -
dotPosition 面板指示点位置 string bottom 可选值为 top bottom left right
dots 是否显示面板指示点 boolean true -
easing 动画效果 string linear -
effect 动画效果函数 scrollx | fade scrollx -

Emits

名称 说明 类型 备注
change 幻灯片切换时触发 (currentSlide: any, nextSlide: any) => void -

Methods

名称 描述 备注
goTo(slideNumber, dontAnimate) 切换到指定面板, dontAnimate = true 时,不使用动画 -
next() 切换到下一面板 -
prev() 切换到上一面板 -

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
thinkingOfBettycommented, Mar 4, 2021
  • autoplay => autoplayTime

    • 说明:自动播放的时间间隔,为 0 时不自动切换
    • 默认值: 0
    • 支持全局配置
  • dotPosition

    • 说明:面板指示点位置
    • 类型:top \| bottom \| left \| right
    • 支持全局配置
  • dots,easing 和 effect 支持全局配置

  • afterChange 和 beforeChange 移除

  • 新增 canDeactivate

    • 说明:是否允许离开当前面板
    • 类型:( from: number; to: number )=> boolean

Emits 新增 change, 切换后的回调,就是你现在的 afterChange

API已修改

0reactions
thinkingOfBettycommented, Mar 4, 2021
  • autoplay => autoplayTime

    • 说明:自动播放的时间间隔,为 0 时不自动切换
    • 默认值: 0
    • 支持全局配置
  • dotPosition

    • 说明:面板指示点位置
    • 类型:top \| bottom \| left \| right
    • 支持全局配置
  • dots,easing 和 effect 支持全局配置

  • afterChange 和 beforeChange 移除

  • 新增 canDeactivate

    • 说明:是否允许离开当前面板
    • 类型:( from: number; to: number )=> boolean

Emits 新增 change, 切换后的回调,就是你现在的 afterChange

走马灯的使用场景基本都是轮播吧,canDeactivate暂时没有想到使用场景,后面业务有需要的话可以再补充; beforechange api也暂时移除,理由同上。

Read more comments on GitHub >

github_iconTop Results From Across the Web

Carousel - Bootstrap
A slideshow component for cycling through elements—images or slides of text—like a carousel. How it works. The carousel is a slideshow for cycling...
Read more >
React-Bootstrap Carousel Component - GeeksforGeeks
Carousel Component provides a way to create a slideshow for our images or text slides with a present full manner in a cyclic...
Read more >
Auto-Rotating Image Carousel Example with Buttons for Slide ...
If the carousel is rotating, the button's accessible name is "Stop Automatic Slide Show", informing screen reader users that the slides are changing...
Read more >
Carousel Usability: Designing an Effective UI for Websites with ...
Carousels allow multiple pieces of content to appear high on the homepage. A good carousel offers visible, understandable controls and ...
Read more >
Product Carousel - AEM Core Components
The Product Carousel component is a server-side component written in HTL, allowing to display a list of featured products in a carousel style....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found