Skip to content

Commit

Permalink
feat(QrCode): 新增二维码中间插入图标
Browse files Browse the repository at this point in the history
Signed-off-by: Tenny <tenny.shu@foxmail.com>
  • Loading branch information
Tenny committed Aug 22, 2024
1 parent 3020909 commit a1be2db
Show file tree
Hide file tree
Showing 5 changed files with 296 additions and 303 deletions.
27 changes: 19 additions & 8 deletions docs/components/qrcode.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,29 @@

<ClientOnly><CodePreview>
<textarea lang="vue-html">
<nt-qrcode text="Hello World" fill="#4998f4" size="120"></nt-qrcode>
<nt-qrcode text="Hello World" fill="#4998f4" :size="120"></nt-qrcode>
</textarea>
</CodePreview></ClientOnly>

### 图标

可以将 `logo` 放入二维码

<ClientOnly>
<CodePreview>
<textarea lang="vue-html">
<nt-qrcode text="Hello World" icon-src="/neatui-vue/img_loading.png"></nt-qrcode>
</textarea>
</CodePreview>
</ClientOnly>

## API

### Qrcode Props

| 参数 | 说明 | 类型 | 默认值 |
| -------- | -------------------------------- | -------- | --------- |
| `text` | 二维码内容 | `string` ||
| `fill` | 二维码颜色 | `string` | `#000000` |
| `size` | 二维码大小 | `string` | `100` |
| `level` | 二维码容错率, `L``M``Q``H` | `string` | `L` |
| `margin` | 二维码边距 | `number` | `0` |
| 参数 | 说明 | 类型 | 默认值 |
| ------- | -------------------------------- | -------- | --------- |
| `text` | 二维码内容 | `string` ||
| `fill` | 二维码颜色 | `string` | `#000000` |
| `size` | 二维码大小 | `string` | `100` |
| `level` | 二维码容错率, `L``M``Q``H` | `string` | `M` |
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@
"publish": "./scripts/publish.ps1 publish"
},
"devDependencies": {
"@types/node": "^22.3.0",
"@typescript-eslint/eslint-plugin": "^8.1.0",
"@typescript-eslint/parser": "^8.1.0",
"@types/node": "^22.5.0",
"@typescript-eslint/eslint-plugin": "^8.2.0",
"@typescript-eslint/parser": "^8.2.0",
"@vitejs/plugin-vue": "^5.1.2",
"eslint": "^9.9.0",
"eslint-plugin-vue": "^9.27.0",
"globals": "^15.9.0",
"prettier": "^3.3.3",
"shiki": "^1.13.0",
"shiki": "^1.14.1",
"typescript": "^5.5.4",
"vite": "^5.4.0",
"vite": "^5.4.2",
"vite-plugin-dts": "4.0.3",
"vitepress": "^1.3.2",
"vitepress": "^1.3.3",
"vue-tsc": "^2.0.29"
},
"peerDependencies": {
Expand Down Expand Up @@ -67,7 +67,7 @@
"dependencies": {
"@tanstack/vue-table": "^8.20.4",
"ph-utils": "^0.8.4",
"qrcode-generator-es": "^0.0.4",
"qrcode-generator-es": "^1.0.1",
"vue-router": "^4.4.3"
},
"packageManager": "pnpm@9.0.2"
Expand Down
Loading

0 comments on commit a1be2db

Please sign in to comment.