🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis
Socket
Book a DemoInstallSign in
Socket

@heypongo/vue3-fortune-wheel

Package Overview
Dependencies
Maintainers
3
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

@heypongo/vue3-fortune-wheel

👊 An easier fortune-wheel in Vue.js 👊

unpublished
latest
npmnpm
Version
1.0.1
Version published
Maintainers
3
Created
Source

vue3-fortune-wheel

👊 An easier fortune-wheel in Vue.js 👊

🔥 Vue3 + Typescript 🔥

Sandbox example

Open this link on a new tab

Edit vue-wheel

Installation

NPM / YARN

Install the package:

npm install vue3-fortune-wheel --save
yarn add vue3-fortune-wheel
import { Wheel } from "vue3-fortune-wheel";
// If you using vite
import 'vue3-fortune-wheel/style'
// If you not
import 'vue3-fortune-wheel/dist/library.css'

export default {
  components: {
    Wheel,
  },
};
<Wheel />

Props/Options

Gift

  • Type: Number
  • Default: null

This data corresponds to the id of your winning object. In my case an API returns me the id. If you are not in this case you can create a method that randomly chooses an id

Exemple of this method

randomGift() {
  return Math.floor(Math.random() * this.data.lengh) + 1
}

animDuration

  • Type: Number
  • Default: 5000

How many millisecondes you want the wheel to turn

Data

  • Type: Array
  • Default: []
  • id: number
  • value: string
  • color: string
  • bgColor: string

Example :

data: [
  {
    id: 1,
    value: "Gift 1",
    color: '#7d7db3',
    bgColor: '#ffffff'
  },
  {
    id: 2,
    value: "Gift 2",
    color: '#ffffff',
    bgColor: '#ffffff'
  },
  {
    id: 3,
    value: "Gift 3",
    color: '#c92729',
    bgColor: '#ffffff'
  },
],

ImgParams

  • Type: Object
  • Default: {}

Possible to add an image in the center

Example :

  {
    src: string
    width: number
    height: number
  }

Contributing to development 💁‍♂️💁‍♀️

  • First create an issue
  • Fork the repo from github.
  • Clone your forked repo and run: yarn or npm i
  • Then, make your changes on any branch you want and push it.
  • Naming your branch with the gitflow convention:
    • Feature branches? [feature/issueId]
    • Release branches? [release/issueId]
    • Hotfix branches? [hotfix/issueId]
    • Support branches? [support/issueId]
  • Finally, open a pull request on the official repo, using the source branch from your forked repo.

Keywords

vue

FAQs

Package last updated on 30 Sep 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts