npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

vue-big-wheel

v1.0.1

Published

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

Readme

vue-big-wheel

vue-big-wheel是一款基于Vue2.x封装的转盘抽奖组件,支持多种配置选项,灵活适用各种场景,且不依赖任何框架,非常小,开箱即用

移动端、PC端页面都能使用

版本说明

npm最新的包是1.x版本,1.x版本完全不兼容0.x,使用0.x版本的注意1.x不兼容0.x,1.x版本代码新增配置奖品图片且使用eslint规范代码且代码逻辑更清晰,比0.x配置更简化且更灵活。

1.x版本为了让指针更好的自定义就没带转盘指针,转盘指针需要自行放置,1.x只渲染转盘

传送到0.x版本

安装

npm i vue-big-wheel -S

使用

在代码中引用,然后使用,参考demo代码 demo引用是直接引用本地组件import BigWheel from '@/components/BigWheel'

你们安装依赖后引用是import BigWheel from 'vue-big-wheel'

API

Props

| 参数 | 说明 | 类型 | 默认值 | | ------------- | ------------------------------------------------------------ | ------ | ---------------------- | | width | 转盘的宽度 | String | 无默认值,必填 | | height | 转盘的高度 | String | 无默认值,必填 | | prizeList | 奖品列表 | Array | - | | prizeBgColors | 每个奖品扇形的背景色,扇形循环数组填充建议和奖品列表同奇偶,如奖品数组长度是奇数,则背景色长度也要是奇数 | Array | ['#F47F45', '#FFA468'] | | borderColor | 每一块扇形的外边框颜色 | String | #ff9800 | | turnsNumber | 转动的圈数 | Number | 5 | | turnsTime | 转动持续时间 | Number | 5(单位是秒) |

Slots

| 名称 | 说明 | | ---- | -------------------------------------------------- | | item | 自定义每个奖品区域显示,参数为每个奖品信息{ item } |

Events

| 事件名 | 说明 | 回调参数 | | ------ | ------------------------ | -------------- | | over | 转盘停止转动后的回调函数 | 中奖的奖品信息 |

方法

通过ref拿到组件实例并调用实例方法this.$refs.bigWheel.rotate(index)

| 方法名 | 说明 | 参数 | 返回值 | | ------ | ------------ | --------------------------------- | ------ | | rotate | 转盘转动方法 | index:中奖奖品在奖品列表中的下标 | - |

Demo

demo是做的手机端页面,电脑查看请用手机模式查看

https://wheel.assetss.cn/v1

手机扫描下面二维码查看

再贴张效果图镇楼:joy:

最后

有问题或者需求等欢迎提Issues,走过路过,点个Star再走呗