vue-luck-draw
| 适配框架 | npm包 | npm下载量 | CDN使用量 |
|---|---|---|---|
JS / JQ |
lucky-canvas | ||
Vue2.x / Vue3.x |
vue-luck-draw | ||
React |
react-luck-draw | ||
UniApp |
uni-luck-draw | / | |
Taro3.x |
taro-luck-draw | / | |
微信小程序 |
mini-luck-draw | / |
官方文档 & Demo演示
English:If anyone can help translate the document, please contact me
ldq404@qq.com
在 vue2.x / vue3.x 中使用
方式 1:通过 import 引入
- 首先安装插件
# npm 安装:
npm install vue-luck-draw
# yarn 安装:
yarn add vue-luck-draw
- 然后找到
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')
- 最后在组件内使用
<LuckyWheel />大转盘抽奖 或<LuckyGrid />九宫格抽奖
<template>
<div>
<!-- 大转盘抽奖 -->
<LuckyWheel
width="200px"
height="200px"
...你的配置
/>
<!-- 九宫格抽奖 -->
<LuckyGrid
width="200px"
height="200px"
...你的配置
/>
</div>
</template>
方式 2:通过 script 标签引入
为了避免 CDN 链接出现异常或波动,我非常建议你缓存到本地或服务器(✿◡‿◡)
-
vue2.x: https://cdn.jsdelivr.net/npm/vue-luck-draw@3.4.6/dist/vue-luck-draw.umd.min.js
-
vue3.x: https://cdn.jsdelivr.net/npm/vue-luck-draw@3.4.6/vue3/vue-luck-draw.umd.min.js
<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
Version History
| Version | Released | Vue | License |
|---|---|---|---|
| 3.4.11 | Apache-2.0 | ||
| 3.4.10 | Apache-2.0 | ||
| 3.4.9 | ^2.0.0 || | Apache-2.0 | |
| 3.4.8 | ^2.0.0 || | Apache-2.0 | |
| 3.4.7 | Apache-2.0 | ||
| 3.4.6 | Apache-2.0 | ||
| 3.4.5 | BSD-3-Clause | ||
| 3.4.4 | BSD-3-Clause | ||
| 3.4.3 | BSD-3-Clause | ||
| 3.4.2 | BSD-3-Clause | ||
| 3.4.1 | BSD-3-Clause | ||
| 3.4.0 | BSD-3-Clause | ||
| 3.3.9 | BSD-3-Clause | ||
| 3.3.8 | BSD-3-Clause | ||
| 3.3.7 | BSD-3-Clause | ||
| 3.3.6 | BSD-3-Clause | ||
| 3.3.5 | BSD-3-Clause | ||
| 3.3.4 | BSD-3-Clause | ||
| 3.3.3 | BSD-3-Clause | ||
| 3.3.2 | BSD-3-Clause | ||
| 3.3.1 | BSD-3-Clause | ||
| 3.3.0 | BSD-3-Clause | ||
| 3.2.1 | BSD-3-Clause | ||
| 3.2.0 | BSD-3-Clause | ||
| 3.1.9 | BSD-3-Clause | ||
| 3.1.8 | BSD-3-Clause | ||
| 3.1.7 | BSD-3-Clause | ||
| 3.1.6 | BSD-3-Clause | ||
| 3.1.5 | BSD-3-Clause | ||
| 3.1.4 | BSD-3-Clause |
Showing the latest 30 of 69. See every release on npm