UNPKG

1.91 kBTypeScriptView Raw
1import { ComponentType } from 'react'
2import { StandardProps } from './common'
3
4interface SwiperItemProps extends StandardProps {
5 /** 该 swiper-item 的标识符
6 * @supported weapp, swan, alipay, tt, h5, rn
7 */
8 itemId?: string
9}
10
11/** 仅可放置在 swiper 组件中,宽高自动设置为100%
12 * > 不要为 `SwiperItem` 设置 **style** 属性,可以通过 class 设置样式。[7147](https://github.com/NervJS/taro/issues/7147)
13 * @classification viewContainer
14 * @supported weapp, swan, alipay, tt, h5, rn
15 * @example_react
16 * ```tsx
17 * class App extends Component {
18 * render () {
19 * return (
20 * <Swiper
21 * className='test-h'
22 * indicatorColor='#999'
23 * indicatorActiveColor='#333'
24 * vertical
25 * circular
26 * indicatorDots
27 * autoplay>
28 * <SwiperItem>
29 * <View className='demo-text-1'>1</View>
30 * </SwiperItem>
31 * <SwiperItem>
32 * <View className='demo-text-2'>2</View>
33 * </SwiperItem>
34 * <SwiperItem>
35 * <View className='demo-text-3'>3</View>
36 * </SwiperItem>
37 * </Swiper>
38 * )
39 * }
40 * }
41 * ```
42 * @example_vue
43 * ```html
44 * <template>
45 * <swiper
46 * class='test-h'
47 * indicator-color='#999'
48 * indicator-active-color='#333'
49 * :vertical="true"
50 * :circular="true"
51 * :indicator-dots="true"
52 * :autoplay="true"
53 * >
54 * <swiper-item>
55 * <view class='demo-text-1'>1</view>
56 * </swiper-item>
57 * <swiper-item>
58 * <view class='demo-text-2'>2</view>
59 * </swiper-item>
60 * <swiper-item>
61 * <view class='demo-text-3'>3</view>
62 * </swiper-item>
63 * </swiper>
64 * </template>
65 * ```
66 * @see https://developers.weixin.qq.com/miniprogram/dev/component/swiper-item.html
67 */
68declare const SwiperItem: ComponentType<SwiperItemProps>
69
70export { SwiperItem, SwiperItemProps }