|
| 1 | +/* eslint-disable */ |
| 2 | + |
| 3 | +/** |
| 4 | + * 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC |
| 5 | + * */ |
| 6 | + |
| 7 | +import { TdSwiperProps } from './type'; |
| 8 | +import { PropType } from 'vue'; |
| 9 | + |
| 10 | +export default { |
| 11 | + /** 轮播切换动画效果类型 */ |
| 12 | + animation: { |
| 13 | + type: String as PropType<TdSwiperProps['animation']>, |
| 14 | + default: 'slide' as TdSwiperProps['animation'], |
| 15 | + validator(val: TdSwiperProps['animation']): boolean { |
| 16 | + if (!val) return true; |
| 17 | + return ['slide'].includes(val); |
| 18 | + }, |
| 19 | + }, |
| 20 | + /** 是否自动播放 */ |
| 21 | + autoplay: { |
| 22 | + type: Boolean, |
| 23 | + default: true, |
| 24 | + }, |
| 25 | + /** 当前轮播在哪一项(下标) */ |
| 26 | + current: { |
| 27 | + type: Number, |
| 28 | + default: undefined, |
| 29 | + }, |
| 30 | + modelValue: { |
| 31 | + type: Number, |
| 32 | + default: undefined, |
| 33 | + }, |
| 34 | + /** 当前轮播在哪一项(下标),非受控属性 */ |
| 35 | + defaultCurrent: { |
| 36 | + type: Number, |
| 37 | + default: 0, |
| 38 | + }, |
| 39 | + /** 轮播滑动方向,包括横向滑动和纵向滑动两个方向 */ |
| 40 | + direction: { |
| 41 | + type: String as PropType<TdSwiperProps['direction']>, |
| 42 | + default: 'horizontal' as TdSwiperProps['direction'], |
| 43 | + validator(val: TdSwiperProps['direction']): boolean { |
| 44 | + if (!val) return true; |
| 45 | + return ['horizontal', 'vertical'].includes(val); |
| 46 | + }, |
| 47 | + }, |
| 48 | + /** 滑动动画时长 */ |
| 49 | + duration: { |
| 50 | + type: Number, |
| 51 | + default: 300, |
| 52 | + }, |
| 53 | + /** 轮播的高度 */ |
| 54 | + height: { |
| 55 | + type: [String, Number] as PropType<TdSwiperProps['height']>, |
| 56 | + }, |
| 57 | + /** 轮播间隔时间 */ |
| 58 | + interval: { |
| 59 | + type: Number, |
| 60 | + default: 5000, |
| 61 | + }, |
| 62 | + /** 是否循环播放 */ |
| 63 | + loop: { |
| 64 | + type: Boolean, |
| 65 | + default: true, |
| 66 | + }, |
| 67 | + /** 导航器全部配置 */ |
| 68 | + navigation: { |
| 69 | + type: [Boolean, Object, Function, Function] as PropType<TdSwiperProps['navigation']>, |
| 70 | + default: true as TdSwiperProps['navigation'], |
| 71 | + }, |
| 72 | + /** 【开发中】后边距,可用于露出后一项的一小部分。默认单位 `px` */ |
| 73 | + nextMargin: { |
| 74 | + type: [String, Number] as PropType<TdSwiperProps['nextMargin']>, |
| 75 | + default: 0 as TdSwiperProps['nextMargin'], |
| 76 | + }, |
| 77 | + /** 【开发中】前边距,可用于露出前一项的一小部分。默认单位 `px` */ |
| 78 | + previousMargin: { |
| 79 | + type: [String, Number] as PropType<TdSwiperProps['previousMargin']>, |
| 80 | + default: 0 as TdSwiperProps['previousMargin'], |
| 81 | + }, |
| 82 | + /** 轮播切换时触发 */ |
| 83 | + onChange: Function as PropType<TdSwiperProps['onChange']>, |
| 84 | + /** 点击轮播项时触发 */ |
| 85 | + onClick: Function as PropType<TdSwiperProps['onClick']>, |
| 86 | +}; |
0 commit comments