Coder Social home page Coder Social logo

hui1943 / vue-luck-draw Goto Github PK

View Code? Open in Web Editor NEW

This project forked from buuing/lucky-canvas

0.0 0.0 0.0 2.92 MB

🎉一个基于 vue2 / vue3 的【大转盘 / 九宫格】抽奖插件;😇A lucky draw plug-in based on vue2 / vue3;🎨奖品 / 文字 / 图片 / 颜色 / 按钮均可配置,支持同步 / 异步抽奖,🏅概率前 / 后端可控,自动根据 dpr 调整清晰度适配移动端

Home Page: https://100px.net/document/vue.html

License: BSD 3-Clause "New" or "Revised" License

Vue 2.03% JavaScript 97.97%

vue-luck-draw's Introduction

logo

vue-luck-draw 抽奖插件

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

简体中文 · English

stars forks version downloads size

author license


官方文档 & Demo演示

中文https://100px.net/document/vue.html

EnglishIf anyone can help translate the document, please contact me [email protected]


在 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 标签引入

从下面的链接里下载vue-luck-draw.umd.min.js文件, 然后使用 script 标签引入

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

vue-luck-draw's People

Contributors

buuing avatar luck-draw avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.