vue-luck-draw

一个支持 vue2 / vue3 的(大转盘抽奖 / 九宫格抽奖)luckydraw 插件
5,998
Install
npm install vue-luck-draw
Latest Version:3.4.11
Older releases:2 · 3
License:Apache-2.0
Last Updated:Sep 30, 2021
Links: npm
Maintainer: buuing
logo

lucky-canvas 抽奖插件

一个基于 JavaScript 的 ( 大转盘 / 九宫格 ) 抽奖插件

简体中文 · English

stars forks author license

适配框架 npm包 npm下载量 CDN使用量
JS / JQ lucky-canvas downloads downloads
Vue2.x / Vue3.x vue-luck-draw downloads downloads
React react-luck-draw downloads downloads
UniApp uni-luck-draw downloads /
Taro3.x taro-luck-draw downloads /
微信小程序 mini-luck-draw downloads /

官方文档 & Demo演示

中文:https://100px.net

English:If anyone can help translate the document, please contact me ldq404@qq.com


在 vue2.x / vue3.x 中使用

方式 1:通过 import 引入

  1. 首先安装插件
# npm 安装:
npm install vue-luck-draw

# yarn 安装:
yarn add vue-luck-draw
  1. 然后找到 main.js 引入插件并 use
// vue2.x
import LuckDraw from 'vue-luck-draw'
Vue.use(LuckDraw)

// vue3.x
import LuckDraw from 'vue-luck-draw/vue3'
createApp(App).use(LuckDraw).mount('#app')
  1. 最后在组件内使用 <LuckyWheel />大转盘抽奖 或 <LuckyGrid />九宫格抽奖
<template>
  <div>
    <!-- 大转盘抽奖 -->
    <LuckyWheel
      width="200px"
      height="200px"
      ...你的配置
    />
    <!-- 九宫格抽奖 -->
    <LuckyGrid
      width="200px"
      height="200px"
      ...你的配置
    />
  </div>
</template>

方式 2:通过 script 标签引入

为了避免 CDN 链接出现异常或波动,我非常建议你缓存到本地或服务器(✿◡‿◡)

<div id="app">
  <!-- 大转盘抽奖 -->
  <lucky-wheel
    width="200px"
    height="200px"
    ...你的配置
  />
  <!-- 九宫格抽奖 -->
  <lucky-grid
    width="200px"
    height="200px"
    ...你的配置
  />
</div>
<script src="./vue.min.js"></script>
<script src="./vue-luck-draw.umd.min.js"></script>
<script>
  new Vue({
    el: '#app',
    data () {
      return {}
    }
  })
</script>

如果您觉得这个项目还不错, 可以在 Github 上面帮我点个star ☜(゚ヮ゚☜)

Related Packages

@lucky-canvas/vue

一个支持 vue2 / vue3 的(大转盘 / 九宫格 / 老虎机)luckydraw 抽奖插件

131,212
vue-big-wheel

基于vue2.*开发的大转盘抽奖组件,开箱即用!

13,394 48

Version History

Version Released Vue License
3.4.11 Apache-2.0
3.4.10 Apache-2.0
3.4.9 ^2.0.0 || >=3.0.0-rc.0 Apache-2.0
3.4.8 ^2.0.0 || >=3.0.0-rc.0 Apache-2.0
3.4.7 Apache-2.0