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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@tanzhenxing/zx-lucky-wheel

v1.0.1

Published

zx-lucky-wheel 幸运转盘组件

Readme

zx-lucky-wheel 大转盘抽奖组件

基于 uni-app + vue3 setup 语法开发,支持 H5、小程序、App(部分平台需兼容),不依赖浏览器特有 DOM。适用于大转盘抽奖等场景。

支持平台

  • H5
  • 微信/支付宝/百度/字节/QQ/快手小程序
  • App(最新版暂不支持,建议 app 端用旧版)

属性(Props)

| 属性名 | 说明 | 类型 | 默认值 | | -------------- | ------------------ | ------- | ---------- | | width | 盒子宽度 | String | 600rpx | | height | 盒子高度 | String | 600rpx | | blocks | 外围装饰块配置 | Array | [] | | prizes | 奖品配置 | Array | [] | | buttons | 按钮配置 | Array | [] | | defaultConfig | 抽奖配置 | Object | {} | | defaultStyle | 样式配置 | Object | {} |

事件(Events)

| 事件名 | 说明 | 回调参数 | | ------ | -------------- | -------- | | start | 开始抽奖时触发 | ...args | | end | 抽奖结束时触发 | ...args |

方法(ref 调用)

| 方法名 | 说明 | | ------------- | -------------- | | init() | 重新初始化 | | play(...args) | 开始抽奖 | | stop(...args) | 停止抽奖 | | getLuckyImage() | 获取当前图片 |

使用示例

<template>
  <view>
    <zx-lucky-wheel
      ref="wheelRef"
      :width="'600rpx'"
      :height="'600rpx'"
      :blocks="blocks"
      :prizes="prizes"
      :buttons="buttons"
      :defaultConfig="defaultConfig"
      :defaultStyle="defaultStyle"
      @start="onStart"
      @end="onEnd"
    />
    <button @click="play">开始抽奖</button>
    <button @click="stop">停止</button>
  </view>
</template>

<script setup>
import { ref } from 'vue'
import ZxLuckyWheel from '@/components/zx-lucky-wheel/zx-lucky-wheel.vue'

const wheelRef = ref()
const blocks = ref([
  { background: '#fff', imgs: [] }
])
const prizes = ref([
  { fonts: [{ text: '一等奖' }], imgs: [] },
  { fonts: [{ text: '二等奖' }], imgs: [] },
  { fonts: [{ text: '三等奖' }], imgs: [] },
])
const buttons = ref([
  { radius: '60px', background: '#f00', fonts: [{ text: '抽奖' }] }
])
const defaultConfig = ref({})
const defaultStyle = ref({})

function play() {
  wheelRef.value.play()
}
function stop() {
  wheelRef.value.stop()
}
function onStart(...args) {
  // 开始抽奖回调
}
function onEnd(...args) {
  // 结束抽奖回调
}
</script>

注意事项

  • App 端如需兼容请使用旧版插件。
  • blocks/prizes/buttons 配置请参考 lucky-canvas 官方文档。