1.0.4 • Published 5 years ago

vue-luckyspin v1.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
5 years ago

vue-luckyspin

npm npm npm

A Vue Lucky Spin Component base on http://dougtesting.net/home

Published on https://www.npmjs.com/package/vue-luckyspin

npm.io

Instalation

run one of the following commands to add this dependency to your project:

$ yarn add vue-luckyspin

or

$ npm i --save vue-luckyspin

Usage

First import the lucky spin component on your javascript section:

import LuckySpin from 'vue-luckyspin'

export default {
  name: 'App',
  components: { LuckySpin },
  data: () => ({
    result: null
  })
}

Then just call it on your HTML section:

<template>
  <div id="app">
    <p>Example Lucky Spin</p>
    <div class="lucky-demo">
      <LuckySpin v-model="result" />
    </div>
  </div>
</template>

Author

Demo

Go to the demo folder and run:

$ yarn install

to install dependencies and then:

$ yarn serve

to run the Vue application.

Props

Use the table below to see what props you can pass to the Component:

PropsTypeValueDefault Value
segmentsArrayUse the following object array model { text: string, winner: boolean }.... The winner field is optional, use it as true if you want the spin to finish on this Segment.6 Prize's Array
fillWithemptyPrizesBooleanInform it as true if you want to fill segments with no prize Segments.false
emptyPrizeTextStringText that ll render if you enable the 'fillWithemptyPrizes' props.'No Prize'
textLimitNumbermaxLength for the text inside segments.14
color1HexHexadecimal color for the primary slot.#fadede
color2HexHexadecimal color for the secondary slot.#000000
noPrizeBooleanForce the WinWheel to stop in 'noPrize' Segment.false
allowMultipleSpinsBooleanFlag that allows the user to spin the Wheel multiple times, set to false to spin it once.true
useSameColorBooleanFlag that set the same colors for all Segments.false
spinTextStringSpin text displayed on Spin Button.'SPIN!'
spinSoundBooleanEnable sound when you spin the win-wheelsfalse
customSpinSoundMp3 FileCustom mp3 sound effect pathfalse

License

This project is licensed under the MIT License - see the LICENSE file for details.

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago