Skip to content

topul/horse-race-lamp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

跑马灯抽奖

<script>
import { ref } from 'vue';
import LuckyGrid from './components/packages/LuckyGrid.vue';
const prizes = [{
  img: 'https://img.yzcdn.cn/vant/apple-1.jpg',
  name: '苹果'
},
{
  img: 'https://img.yzcdn.cn/vant/apple-1.jpg',
  name: '苹果'
},
{
  img: 'https://img.yzcdn.cn/vant/apple-1.jpg',
  name: '苹果'
},
{
  img: 'https://img.yzcdn.cn/vant/apple-1.jpg',
  name: '苹果'
},
{
  img: 'https://img.yzcdn.cn/vant/apple-1.jpg',
  name: '苹果'
},
{
  img: 'https://img.yzcdn.cn/vant/apple-1.jpg',
  name: '苹果'
},
{
  img: 'https://img.yzcdn.cn/vant/apple-1.jpg',
  name: '苹果'
},
{
  img: 'https://img.yzcdn.cn/vant/apple-1.jpg',
  name: '苹果'
},
{
  img: 'https://img.yzcdn.cn/vant/apple-1.jpg',
  name: '苹果'
},
{
  img: 'https://img.yzcdn.cn/vant/apple-1.jpg',
  name: '苹果'
},
{
  img: 'https://img.yzcdn.cn/vant/apple-1.jpg',
  name: '苹果'
},
{
  img: 'https://img.yzcdn.cn/vant/apple-1.jpg',
  name: '苹果'
}]

const luckyGrid = ref(null)
const start = () => {
  console.log('start')
  luckyGrid.value.start()
  setTimeout(() => {
    luckyGrid.value.stop()
  }, 3000);
}
const luckyStop = (reward) => {
  console.log('stop', reward)
}
</script>
<template>
<LuckyGrid ref="luckyGrid" :prizes="prizes" @stop="luckyStop" />
<button @click="start">开始</button>
</template>

About

跑马灯抽奖效果

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published