1.1.5 • Published 7 years ago
lucky-wheel v1.1.5
lucky-wheel使用说明
- 安装lucky-wheel包
npm install -S lucky-wheel
- render组件
import LuckyWheel from 'lucky-wheel';
constructor(props) {
super(props);
this.state = {
position: 0,
isComplete: false
}
}
handleLoadData = () => {
setTimeout(() => {
this.setState({
position: 2,
isComplete: true
})
}, 1000);
}
handleComplete = () => {
this.setState({isComplete: false})
}
render() {
return (
<LuckyWheel
onLoadData={this.handleLoadData}
position={position}
areaNum={7}
cycle={10}
isComplete={isComplete}
onComplete={this.handleComplete}
/>
)
}