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

[comp:Carousel] feature Carousel component #230

Closed
1 task
thinkingOfBetty opened this issue Mar 3, 2021 · 7 comments · Fixed by #634
Closed
1 task

[comp:Carousel] feature Carousel component #230

thinkingOfBetty opened this issue Mar 3, 2021 · 7 comments · Fixed by #634
Assignees

Comments

@thinkingOfBetty
Copy link
Contributor

thinkingOfBetty commented Mar 3, 2021

  • 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() 切换到上一面板 -
@danranVm
Copy link
Member

danranVm commented Mar 3, 2021

@clfeng @danranVm review 一下 API 设计

@clfeng
Copy link
Contributor

clfeng commented Mar 3, 2021

dots 和dotsClass还是区分开来做成两个不同的接口吧;dots就单纯的控制是否展示;dotsClass就单纯的定义dots的自定义类;混在一起在使用和认知上感觉还是不大好,尽量保持一个属性的功能定位纯粹一些

@clfeng
Copy link
Contributor

clfeng commented Mar 3, 2021

afterChange 和beforeChange的说明给区别一下;切换面板前的回调和切换面板后的回调

@danranVm
Copy link
Member

danranVm commented Mar 3, 2021

  • autoplay => autoplayTime
    • 说明:自动播放的时间间隔,为 0 时不自动切换
    • 默认值: 0
    • 支持全局配置
  • dotPosition
    • 说明:面板指示点位置
    • 类型:top \| bottom \| left \| right
    • 支持全局配置
  • dots,easing 和 effect 支持全局配置
  • afterChange 和 beforeChange 移除
  • 新增 canDeactivate
    • 说明:是否允许离开当前面板
    • 类型:( from: number; to: number )=> boolean

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

@danranVm
Copy link
Member

danranVm commented Mar 3, 2021

dots 和dotsClass还是区分开来做成两个不同的接口吧;dots就单纯的控制是否展示;dotsClass就单纯的定义dots的自定义类;混在一起在使用和认知上感觉还是不大好,尽量保持一个属性的功能定位纯粹一些

干脆 dots 只支持 boolean 吧, object 的形式以后有需求再加。

@danranVm danranVm mentioned this issue Mar 3, 2021
95 tasks
@thinkingOfBetty
Copy link
Contributor Author

  • 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也暂时移除,理由同上。

@thinkingOfBetty
Copy link
Contributor Author

  • autoplay => autoplayTime

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

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

  • afterChange 和 beforeChange 移除

  • 新增 canDeactivate

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

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

API已修改

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants