1.0.2 • Published 2 years ago
@ivertu/lottery v1.0.2
<script lang="ts">
import { Prize, Result, Wheel } from '@ivertu/lottery';
let data: Prize[] = [
{ text: '一等奖' },
{ text: '谢谢惠顾' },
{ text: '二等奖' },
{ text: '参与奖' },
{ text: '谢谢惠顾' },
{ text: '三等奖' }
];
let index = 3;
const handleEnd = (e) => {
console.log('中奖了', e);
};
</script>
<div class="container">
<Wheel {data} {index} on:end={handleEnd} />
</div>
<style global>
html,
body {
margin: 0;
}
.container {
padding: 30px;
}
</style>