相关文章推荐
大方的地瓜  ·  安卓蓝牙键盘鼠标映射_蓝牙鼠标模拟器-腾讯云 ...·  1 年前    · 
踢足球的洋葱  ·  如何为SpringBoot应用设置健康检查_ ...·  2 年前    · 
有胆有识的大熊猫  ·  Java ...·  2 年前    · 
暗恋学妹的移动电源  ·  自定义实现JAVA线程池的线程工厂类——Th ...·  2 年前    · 
打盹的板栗  ·  Node.js精进(2)——异步编程 - ...·  2 年前    · 
Code  ›  options | vue-concise-slider
https://warpcgd.github.io/vue-concise-slider/zh/docs.html
坐怀不乱的作业本
9 月前
vue-concise-slider
首页
示例
文档
教程
选择语言
  • English
  • 简体中文
首页
示例
文档
教程
选择语言
  • English
  • 简体中文
  • options

    • 基础信息
      • effect
      • direction
      • currentPage
      • thresholdDistance
      • thresholdTime
      • autoplay
      • loop
      • loopedSlides
      • slidesToScroll
      • preventDocumentMove
      • speed
      • timingFunction
      • pagination
      • renderPagination
      • centeredSlides
      • itemAnimation
      • freeze
      • preventRebound
    • CoverFlow options
      • widthScalingRatio
      • heightScalingRatio
      • deviation
    • 嵌套配置
      • nested
    • 传递的事件
      • slideTo
      • slideNext
      • slidePre
      • autoplayStart
      • autoplayStop
    • 监听的事件
      • slide
      • tap
      • init

# options

# 基础信息

  • 类型: Object
  • 默认值: null

滑动配置

  {
    currentPage: 0,//当前页码
    thresholdDistance: 500,//滑动判定距离
    thresholdTime: 100,//滑动判定时间
    autoplay:1000,//自动滚动[ms]
    loop:true,//循环滚动
    direction:'vertical',//方向设置,垂直滚动
    loopedSlides:1,//无限滚动前后遍历数
    slidesToScroll:1,//每次滑动项数

# effect

  • 类型: string
  • 默认值: slide

切换效果,默认为滚动滑动('slide'),可设置为渐变滑动('fade'),旋转滚动('coverflow')

  {
    effect:'slide'

# direction

  • 类型: string
  • 默认值: horizontal

方向设置,默认为水平滚动('horizontal'),可设置为垂直滚动('vertical')

  {
    direction:'horizontal'

# currentPage

  • 类型: number
  • 默认值: 0

初始化slider时为第几页

  {
    currentPage:0

# thresholdDistance

  • 类型: number
  • 默认值: 100

触发滑动的距离阈值

  {
    thresholdDistance:'100'

# thresholdTime

  • 类型: number
  • 默认值: 500

触发滑动的时间阈值

  {
    thresholdTime:'500'

# autoplay

  • 类型: number
  • 默认值: number[ms]

自动播放的时间

  {
    autoplay:'1000'

# loop

  • 类型: boolean
  • 默认值: false

是否循环滚动

  {
    loop:false

# loopedSlides

  • 类型: number
  • 默认值: 1

loop设置为true时,设置前后复制页面的数量

  {
    loopedSlides:1

# slidesToScroll

  • 类型: number
  • 默认值: 1

每次滑动切换的页数

  {
    slidesToScroll:1

# preventDocumentMove

  • 类型: boolean
  • 默认值: false

阻止touch事件触发时,整个页面的滚动

  {
    preventDocumentMove:true

# speed

  • 类型: number[ms]
  • 默认值: 300

滑动持续时间[ms]

  {
    speed: 300

# timingFunction

  • 类型: string
  • 默认值: ease

滑动方式

  {
    timingFunction: 'ease'

# pagination

  • 类型: boolean
  • 默认值: true

所有模式下分页是否显示

  {
    pagination: true

# renderPagination

  • 类型: function
  • 默认值: null
  • 参数: createElement, index

自定义分页函数,参数为vue的createElement函数,和当前页码index

  {
    renderPagination: (h, index) => {
      return h('div', {
        class: 'swiper-pagination-bullet'
      }, [index])

# centeredSlides

  • 类型: boolean
  • 默认值: false

是否居中滑动

  {
    centeredSlides: true

# itemAnimation

  • 类型: boolean
  • 默认值: false

在无限滚动中使用itemAnimation,保证最后一个到第一个(第一个到最后一个)特效结束后才能继续滑动

  {
    itemAnimation: true

# freeze

  • 类型: boolean
  • 默认值: false

阻止touch滑动

  {
    freeze: false

# preventRebound

  • 类型: boolean
  • 默认值: false

阻止回弹

  {
    preventRebound: false

# CoverFlow options

# widthScalingRatio

  • 类型: string
  • 默认值: 0.8

coverflow模式下配置宽度比例缩放,范围0~1

  {
    widthScalingRatio: '0.8'

# heightScalingRatio

  • 类型: string
  • 默认值: 0.8

coverflow模式下配置高度比例缩放,范围0~1

  {
    heightScalingRatio: '0.8'

# deviation

  • 类型: string
  • 默认值: 200

coverflow模式下配置滑动项偏移

  {
    deviation: '200'

# 嵌套配置

# nested

  • 类型: boolean
  • 默认值: true

用于嵌套相同方向的swiper时,当子swiper切换完的时候,开启父swiper的切换

  {
    nested: false

# 传递的事件

# slideTo

  • 参数: number

滑动到(number)页

  slideTo () {
    this.$refs.slider.$emit('slideTo', num)

# slideNext

  • 参数: null

滑动到下一页

  slideNext () {
    this.$refs.slider.$emit('slideNext')

# slidePre

  • 参数: null

滑动到上一页

  slide () {
    this.$refs.slider.$emit('slidePre')

# autoplayStart

  • 参数: ms

开启定时轮播,设置轮播时长

  this.$refs.slider.$emit('autoplayStart',1000)

# autoplayStop

  • 参数:``

暂停定时轮播

  this.$refs.slider.$emit('autoplayStop')

# 监听的事件

# slide

  • 参数: obj

当前滑动到第几页,参数为slider基础信息

  slide (data) {
    console.log(data)

# tap

  • 参数: obj

当前点击第几页,参数为slider基础信息

  tap (data) {
    console.log(data)

# init

  • 参数: obj

初始化成功事件,参数为slider基础信息

  init (data) {
 
推荐文章
大方的地瓜  ·  安卓蓝牙键盘鼠标映射_蓝牙鼠标模拟器-腾讯云开发者社区-腾讯云
1 年前
踢足球的洋葱  ·  如何为SpringBoot应用设置健康检查_Serverless 应用引擎(SAE)-阿里云帮助中心
2 年前
有胆有识的大熊猫  ·  Java for()循环和foreach()循环的选择使用(谁更高效?)_java for循环和foreach-CSDN博客
2 年前
暗恋学妹的移动电源  ·  自定义实现JAVA线程池的线程工厂类——ThreadFactory - 简书
2 年前
打盹的板栗  ·  Node.js精进(2)——异步编程 - 咖啡机(K.F.J) - 博客园
2 年前
今天看啥   ·   Py中国   ·   codingpro   ·   小百科   ·   link之家   ·   卧龙AI搜索
删除内容请联系邮箱 2879853325@qq.com
Code - 代码工具平台
© 2024 ~ 沪ICP备11025650号