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

vue3-qrcode-component

v1.0.3

Published

一个支持自定义属性的 Vue 3 二维码组件

Readme

Vue3 二维码组件

一个可自定义的 Vue 3 二维码组件。

特性

  • 完全可自定义(尺寸、颜色、图标)
  • TypeScript 支持
  • 使用 Vite 构建
  • 简单易用
  • Vue 3 组合式 API

安装

npm install vue3-qrcode-component

或者

yarn add vue3-qrcode-component

或者

pnpm add vue3-qrcode-component

使用方法

全局注册

import { createApp } from 'vue'
import App from './App.vue'
import Qrcode from 'vue3-qrcode-component'

const app = createApp(App)
app.use(Qrcode)
app.mount('#app')
<template>
  <Qrcode url="https://github.com" />
</template>

局部注册

<template>
  <Qrcode 
    url="https://vuejs.org"
    :wid="150"
    :hei="150"
    colorDark="#42b983"
    colorLight="#ffffff"
    iconurl="https://cn.vuejs.org/images/logo.png"
    :imgwid="30"
    :imghei="30"
  />
</template>

<script setup lang="ts">
import { Qrcode } from 'vue3-qrcode-component'
</script>

属性配置

| 属性 | 说明 | 类型 | 默认值 | |----------|-------------|------|---------| | url | 二维码输入的内容 | String | 'www.baidu.com' | | iconurl | 二维码中间小图片地址(可选) | String | undefined | | wid | 二维码宽度 | Number | 70 | | hei | 二维码高度 | Number | 70 | | colorDark | 二维码颜色 | String | '#000000' | | colorLight | 二维码背景色 | String | '#ffffff' | | imgwid | 二维码中间小图片宽度 | Number | 30 | | imghei | 二维码中间小图片高度 | Number | 30 | | correctLevel | 容错级别 (0-3: L/M/Q/H) | Number | 3 | | margin | 二维码留白间距(单位:模块数) | Number | 0 |

注意:

  • iconurl 是可选参数。如果不传此参数,二维码将不显示中间图标。
  • margin 控制二维码周围的留白。设置为 0 时完全铺满无留白,使用 1-4 的值可以提高扫码识别率。

使用示例

基础用法(无图标)

<Qrcode url="https://github.com" />

自定义尺寸和颜色

<Qrcode 
  url="https://vuejs.org"
  :wid="200"
  :hei="200"
  colorDark="#4CAF50"
  colorLight="#E8F5E9"
/>

带中心图标

<Qrcode 
  url="https://cn.vuejs.org"
  iconurl="https://cn.vuejs.org/images/logo.png"
  :wid="200"
  :hei="200"
  :imgwid="40"
  :imghei="40"
/>

自定义留白间距

<!-- 无留白 - 完全铺满 -->
<Qrcode 
  url="https://github.com"
  :wid="200"
  :hei="200"
  :margin="0"
/>

<!-- 最小留白 -->
<Qrcode 
  url="https://github.com"
  :wid="200"
  :hei="200"
  :margin="1"
/>

<!-- 标准留白 - 推荐使用,扫码识别率更高 -->
<Qrcode 
  url="https://github.com"
  :wid="200"
  :hei="200"
  :margin="4"
/>

开发

# 安装依赖
npm install

# 启动开发服务器
npm run dev

# 构建库
npm run build

# 预览构建结果
npm run preview

许可证

MIT

作者

全栈若城

贡献

欢迎贡献代码!请随时提交 Pull Request。