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

@lucky-canvas/uni

v0.0.14

Published

uni-app【大转盘 / 九宫格 / 老虎机】抽奖插件

Readme

|适配框架|npm下载量|CDN使用量| | :-: | :-: | :-: | |JS / JQ 中使用||| |Vue 中使用||| |React 中使用||-| |UniApp 中使用||-| |Taro3.x 中使用||-| |微信小程序 中使用||-|

官方文档 & Demo演示

中文https://100px.net

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

在 uni-app 中使用

1. 安装插件

# npm 安装:
npm install @lucky-canvas/uni

# yarn 安装:
yarn add @lucky-canvas/uni

2. 引入并使用

<view>
  <!-- 大转盘抽奖 -->
  <LuckyWheel
    width="600rpx"
    height="600rpx"
    ...你的配置
  />
  <!-- 九宫格抽奖 -->
  <LuckyGrid
    width="600rpx"
    height="600rpx"
    ...你的配置
  />
</view>
// npm 下载会默认到 node_modules 里面,直接引入包名即可
import LuckyWheel from '@lucky-canvas/uni/lucky-wheel' // 大转盘
import LuckyGrid from '@lucky-canvas/uni/lucky-grid' // 九宫格

// 如果你是通过 HBuilderX 导入插件,那你需要指定一下路径
// import LuckyWheel from '@/components/@lucky-canvas/uni/lucky-wheel' // 大转盘
// import LuckyGrid from '@/components/@lucky-canvas/uni/lucky-grid' // 九宫格

export default {
  // 注册组件
  components: { LuckyWheel, LuckyGrid },
}

3. 我提供了一个最基本的 demo 供你用于尝试

由于 uni-app 渲染 md 的时候会出问题,所以我把 demo 代码放到了文档里

4. 补充说明

5. 常见问题

  1. 转盘层级太高了, 我的弹窗盖不住怎么办?

答: 因为小程序里canvas是原生组件顶层渲染, 我无法控制canvas的层级, 如果你想盖住它也肯简单, 你可以百度搜索<cover>组件

  1. 你这些素材, 图片组件从哪下载?

答: 官网里的任何图片素材, 所使用到的图片资源均为学习交流使用, 请勿将其用于商业用途, 由此产生的任何商业纠纷我这边概不负责

  1. xxx属性怎么使用? xxx方法怎么调用?

答: 自己去看文档, 不然难道要我把代码给你写好吗?

  1. 这个属性的效果与官网的描述不一致?

答: 可能有bug, 你可以去github上的issues去提问 (请认真填写模板)

  1. 为什么这个插件不支持app和其他小程序

答: 没时间, 但是希望志同道合的同学来一起参与uniapp的兼容开发


作者留言: 为了使我自己保持心情愉悦, 低于5星的提问我用浏览器插件都屏蔽了