forked from ElemeFE/element-react
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCarousel.tsx
62 lines (59 loc) · 2.06 KB
/
Carousel.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import * as React from 'react'
import { Carousel } from 'element-react'
import { Carousel as CarouselNext } from 'element-react/next'
class Component extends React.Component<{}, {}> {
onChange = (current, prev) => { }
render() {
return (
<div>
<Carousel className="className" style={{ width: 100 }}>
<Carousel.Item className="className" style={{ width: 100 }}>
<h3>idi</h3>
</Carousel.Item>
</Carousel>
<Carousel interval="3000" indicatorPosition="none" arrow="always">
<Carousel.Item>
<h3>idi</h3>
</Carousel.Item>
</Carousel>
<Carousel arrow="hover">
<Carousel.Item>
<h3>idi</h3>
</Carousel.Item>
</Carousel>
<Carousel initialIndex={1} height="200" trigger="click" autoplay={true} interval={3000} indicatorPosition="outside" indicator={true} arrow="never" type="card" onChange={this.onChange}>
<Carousel.Item name="name">
<h3>idi</h3>
</Carousel.Item>
</Carousel>
<CarouselNext className="className" style={{ width: 100 }}>
<CarouselNext.Item className="className" style={{ width: 100 }}>
<h3>idi</h3>
</CarouselNext.Item>
</CarouselNext>
<CarouselNext interval="3000" indicatorPosition="none" arrow="always">
<CarouselNext.Item>
<h3>idi</h3>
</CarouselNext.Item>
</CarouselNext>
<CarouselNext arrow="hover">
<CarouselNext.Item>
<h3>idi</h3>
</CarouselNext.Item>
</CarouselNext>
<CarouselNext initialIndex={1} height="200" trigger="click" autoplay={true} interval={3000} indicatorPosition="outside" indicator={true} arrow="never" type="card" onChange={this.onChange}>
<CarouselNext.Item name="name">
<h3>idi</h3>
</CarouselNext.Item>
</CarouselNext>
</div>
)
}
}
class CarouselComponent extends Carousel {
componentDidMount() {
this.setActiveItem(1)
this.prev()
this.next()
}
}