From 3b03f87a02458f719e2eb4bf112a13441b427d14 Mon Sep 17 00:00:00 2001 From: ‘chensiAb’ <‘chenchenco03@163.com’> Date: Tue, 25 Mar 2025 13:54:34 +0800 Subject: [PATCH] Merge branch 'master' of ssh://dev.zhiheiot.com:29418/mob-components --- _cursor.ai/plugins.doc/qrcode.doc/CQRCode.doc.md | 76 ++++++++++++++++++++++++++++++++++++++ 1 files changed, 76 insertions(+), 0 deletions(-) diff --git a/_cursor.ai/plugins.doc/qrcode.doc/CQRCode.doc.md b/_cursor.ai/plugins.doc/qrcode.doc/CQRCode.doc.md new file mode 100644 index 0000000..2ba3a34 --- /dev/null +++ b/_cursor.ai/plugins.doc/qrcode.doc/CQRCode.doc.md @@ -0,0 +1,76 @@ +# CQRCode 二维码组件 + +## 功能说明 + +该组件用于在页面中生成二维码,支持在H5环境下保存二维码图片到本地,界面简洁直观。 + +## 引用方式 + +```js +import { CQRCode } from '@components/plugins/qrcode'; +``` + +## 组件参数 + +- `content` (String,默认值:'http://www.aisim.cn'):二维码内容,通常为URL地址 +- `size` (Number,默认值:200):二维码尺寸,单位为像素 +- `margin` (Number,默认值:2):二维码边距大小 +- `downloadable` (Boolean,默认值:false):是否显示"保存到手机"按钮 + +## 实例方法 + +组件没有对外暴露的实例方法 + +## 使用示例 + +### 基础用法 + +```html +<template> + <view class="page"> + <!-- 简单用法 --> + <CQRCode content="https://www.example.com" /> + </view> +</template> + +<script> +import { CQRCode } from '@components/plugins/qrcode'; + +export default { + components: { + CQRCode + } +} +</script> +``` + +### 带保存按钮的用法 + +```html +<template> + <view class="page"> + <CQRCode + content="https://www.example.com" + :size="300" + :margin="4" + :downloadable="true" + /> + </view> +</template> + +<script> +import { CQRCode } from '@components/plugins/qrcode'; + +export default { + components: { + CQRCode + } +} +</script> +``` + +## 注意事项 + +- 目前在H5环境中支持保存二维码图片到本地 +- 小程序环境下的保存功能尚未实现 +- 二维码内容变更时会自动重新渲染 \ No newline at end of file -- Gitblit v1.9.1