Skip to content

Commit bedd07e

Browse files
feat(qrcode): add code tips (#5758)
* feat(qrcode): add code tips * chore: stash changelog [ci skip] --------- Co-authored-by: tdesign-bot <[email protected]>
1 parent 0e1337f commit bedd07e

File tree

5 files changed

+236
-0
lines changed

5 files changed

+236
-0
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
pr_number: 5758
3+
contributor: liweijie0812
4+
---
5+
6+
- feat(QRcode): 增加编辑器代码提示, 请注意该组件暂时不支持 `unplugin-auto-import` 的使用方式 ⚠️ @liweijie0812 ([#5758](https://github.com/Tencent/tdesign-vue-next/pull/5758))

packages/tdesign-vue-next/global.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ declare module 'vue' {
8484
TPopup: typeof import('tdesign-vue-next')['Popup'];
8585
TPrimaryTable: typeof import('tdesign-vue-next')['PrimaryTable'];
8686
TProgress: typeof import('tdesign-vue-next')['Progress'];
87+
TQrcode: typeof import('tdesign-vue-next')['QRCode'];
8788
TRadio: typeof import('tdesign-vue-next')['Radio'];
8889
TRadioButton: typeof import('tdesign-vue-next')['RadioButton'];
8990
TRadioGroup: typeof import('tdesign-vue-next')['RadioGroup'];

packages/tdesign-vue-next/helper/attributes.json

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5547,6 +5547,70 @@
55475547
"type": "String",
55485548
"description": "进度条未完成部分颜色\n\ndefault: ''\n\n[docs](https://tdesign.tencent.com/vue-next/components/progress?tab=api#progress-props)"
55495549
},
5550+
"t-qrcode/bg-color": {
5551+
"type": "String",
5552+
"description": "QR code background color\n\n二维码背景颜色\n\n[docs](https://tdesign.tencent.com/vue-next/components/qrcode?tab=api#qrcode-props)"
5553+
},
5554+
"t-qrcode/borderless": {
5555+
"type": "Boolean",
5556+
"description": "Is there a border\n\n是否有边框\n\ndefault: false\n\n[docs](https://tdesign.tencent.com/vue-next/components/qrcode?tab=api#qrcode-props)"
5557+
},
5558+
"t-qrcode/color": {
5559+
"type": "String",
5560+
"description": "QR code color\n\n二维码颜色\n\n[docs](https://tdesign.tencent.com/vue-next/components/qrcode?tab=api#qrcode-props)"
5561+
},
5562+
"t-qrcode/icon": {
5563+
"type": "String",
5564+
"description": "The address of the picture in the QR code\n\n二维码中图片的地址\n\n[docs](https://tdesign.tencent.com/vue-next/components/qrcode?tab=api#qrcode-props)"
5565+
},
5566+
"t-qrcode/icon-size": {
5567+
"type": "Number|Object",
5568+
"description": "The size of the picture in the QR code\n\n二维码中图片的大小\n\ndefault: 40\n\n[docs](https://tdesign.tencent.com/vue-next/components/qrcode?tab=api#qrcode-props)"
5569+
},
5570+
"t-qrcode/level": {
5571+
"type": "String",
5572+
"options": [
5573+
"L",
5574+
"M",
5575+
"Q",
5576+
"H"
5577+
],
5578+
"description": "QR code error correction level\n\n二维码纠错等级\n\ndefault: M\n\n[docs](https://tdesign.tencent.com/vue-next/components/qrcode?tab=api#qrcode-props)"
5579+
},
5580+
"t-qrcode/size": {
5581+
"type": "Number",
5582+
"description": "QR code size\n\n二维码大小\n\ndefault: 160\n\n[docs](https://tdesign.tencent.com/vue-next/components/qrcode?tab=api#qrcode-props)"
5583+
},
5584+
"t-qrcode/status": {
5585+
"type": "String",
5586+
"options": [
5587+
"active",
5588+
"expired",
5589+
"loading",
5590+
"scanned"
5591+
],
5592+
"description": "QR code status\n\n二维码状态\n\ndefault: active\n\n[docs](https://tdesign.tencent.com/vue-next/components/qrcode?tab=api#qrcode-props)"
5593+
},
5594+
"t-qrcode/status-render": {
5595+
"type": "TNode",
5596+
"description": "Custom state renderer\n\n自定义状态渲染器\n\n[docs](https://tdesign.tencent.com/vue-next/components/qrcode?tab=api#qrcode-props)"
5597+
},
5598+
"t-qrcode/type": {
5599+
"type": "String",
5600+
"options": [
5601+
"canvas",
5602+
"svg"
5603+
],
5604+
"description": "render type\n\n渲染类型\n\ndefault: canvas\n\n[docs](https://tdesign.tencent.com/vue-next/components/qrcode?tab=api#qrcode-props)"
5605+
},
5606+
"t-qrcode/value": {
5607+
"type": "String",
5608+
"description": "scanned text\n\n扫描后的文本\n\n[docs](https://tdesign.tencent.com/vue-next/components/qrcode?tab=api#qrcode-props)"
5609+
},
5610+
"t-qrcode/refresh": {
5611+
"type": "event",
5612+
"description": "Click the \"Click to refresh\" callback\n\n点击\"点击刷新\"的回调\n\n[docs](https://tdesign.tencent.com/vue-next/components/qrcode?tab=api#qrcode-events)"
5613+
},
55505614
"t-radio/allow-uncheck": {
55515615
"type": "Boolean",
55525616
"description": "是否允许取消选中\n\ndefault: false\n\n[docs](https://tdesign.tencent.com/vue-next/components/radio?tab=api#radio-props)"

packages/tdesign-vue-next/helper/tags.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1626,6 +1626,23 @@
16261626
],
16271627
"description": "Progress\n\n进度条\n\n[docs](https://tdesign.tencent.com/vue-next/components/progress)"
16281628
},
1629+
"t-qrcode": {
1630+
"attributes": [
1631+
"bg-color",
1632+
"borderless",
1633+
"color",
1634+
"icon",
1635+
"icon-size",
1636+
"level",
1637+
"size",
1638+
"status",
1639+
"status-render",
1640+
"type",
1641+
"value",
1642+
"refresh"
1643+
],
1644+
"description": "QRCode\n\n二维码\n\n[docs](https://tdesign.tencent.com/vue-next/components/qrcode)"
1645+
},
16291646
"t-radio": {
16301647
"attributes": [
16311648
"allow-uncheck",

packages/tdesign-vue-next/helper/web-types.json

Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12438,6 +12438,154 @@
1243812438
}
1243912439
]
1244012440
},
12441+
{
12442+
"name": "t-qrcode",
12443+
"source": {
12444+
"symbol": "QRCode"
12445+
},
12446+
"description": "QRCode\n\n二维码",
12447+
"doc-url": "https://tdesign.tencent.com/vue-next/components/qrcode",
12448+
"props": [
12449+
{
12450+
"name": "bg-color",
12451+
"description": "QR code background color\n\n二维码背景颜色",
12452+
"doc-url": "https://tdesign.tencent.com/vue-next/components/qrcode?tab=api#qrcode-props",
12453+
"type": "string"
12454+
},
12455+
{
12456+
"name": "borderless",
12457+
"description": "Is there a border\n\n是否有边框",
12458+
"doc-url": "https://tdesign.tencent.com/vue-next/components/qrcode?tab=api#qrcode-props",
12459+
"type": "boolean",
12460+
"default": "false"
12461+
},
12462+
{
12463+
"name": "color",
12464+
"description": "QR code color\n\n二维码颜色",
12465+
"doc-url": "https://tdesign.tencent.com/vue-next/components/qrcode?tab=api#qrcode-props",
12466+
"type": "string"
12467+
},
12468+
{
12469+
"name": "icon",
12470+
"description": "The address of the picture in the QR code\n\n二维码中图片的地址",
12471+
"doc-url": "https://tdesign.tencent.com/vue-next/components/qrcode?tab=api#qrcode-props",
12472+
"type": "string"
12473+
},
12474+
{
12475+
"name": "icon-size",
12476+
"description": "The size of the picture in the QR code\n\n二维码中图片的大小",
12477+
"doc-url": "https://tdesign.tencent.com/vue-next/components/qrcode?tab=api#qrcode-props",
12478+
"type": "number | { width: number; height: number }",
12479+
"default": "40"
12480+
},
12481+
{
12482+
"name": "level",
12483+
"description": "QR code error correction level\n\n二维码纠错等级",
12484+
"doc-url": "https://tdesign.tencent.com/vue-next/components/qrcode?tab=api#qrcode-props",
12485+
"type": "'L' | 'M' | 'Q' | 'H'",
12486+
"default": "M",
12487+
"attribute-value": {
12488+
"type": "enum"
12489+
},
12490+
"values": [
12491+
{
12492+
"name": "L"
12493+
},
12494+
{
12495+
"name": "M"
12496+
},
12497+
{
12498+
"name": "Q"
12499+
},
12500+
{
12501+
"name": "H"
12502+
}
12503+
]
12504+
},
12505+
{
12506+
"name": "size",
12507+
"description": "QR code size\n\n二维码大小",
12508+
"doc-url": "https://tdesign.tencent.com/vue-next/components/qrcode?tab=api#qrcode-props",
12509+
"type": "number",
12510+
"default": "160"
12511+
},
12512+
{
12513+
"name": "status",
12514+
"description": "QR code status\n\n二维码状态",
12515+
"doc-url": "https://tdesign.tencent.com/vue-next/components/qrcode?tab=api#qrcode-props",
12516+
"type": "QRStatus",
12517+
"default": "active",
12518+
"attribute-value": {
12519+
"type": "enum"
12520+
},
12521+
"values": [
12522+
{
12523+
"name": "active"
12524+
},
12525+
{
12526+
"name": "expired"
12527+
},
12528+
{
12529+
"name": "loading"
12530+
},
12531+
{
12532+
"name": "scanned"
12533+
}
12534+
]
12535+
},
12536+
{
12537+
"name": "status-render",
12538+
"description": "Custom state renderer\n\n自定义状态渲染器",
12539+
"doc-url": "https://tdesign.tencent.com/vue-next/components/qrcode?tab=api#qrcode-props",
12540+
"type": "(info:StatusRenderInfo) => TNode"
12541+
},
12542+
{
12543+
"name": "type",
12544+
"description": "render type\n\n渲染类型",
12545+
"doc-url": "https://tdesign.tencent.com/vue-next/components/qrcode?tab=api#qrcode-props",
12546+
"type": "'canvas' | 'svg'",
12547+
"default": "canvas",
12548+
"attribute-value": {
12549+
"type": "enum"
12550+
},
12551+
"values": [
12552+
{
12553+
"name": "canvas"
12554+
},
12555+
{
12556+
"name": "svg"
12557+
}
12558+
]
12559+
},
12560+
{
12561+
"name": "value",
12562+
"description": "scanned text\n\n扫描后的文本",
12563+
"doc-url": "https://tdesign.tencent.com/vue-next/components/qrcode?tab=api#qrcode-props",
12564+
"type": "string"
12565+
}
12566+
],
12567+
"js": {
12568+
"events": [
12569+
{
12570+
"name": "refresh",
12571+
"description": "Click the \"Click to refresh\" callback\n\n点击\"点击刷新\"的回调",
12572+
"doc-url": "https://tdesign.tencent.com/vue-next/components/qrcode?tab=api#qrcode-events"
12573+
}
12574+
]
12575+
},
12576+
"slots": [
12577+
{
12578+
"name": "statusRender",
12579+
"description": "Custom state renderer\n\n自定义状态渲染器类型和参数:(info:StatusRenderInfo) => TNode【type StatusRenderInfo = {status:QRStatus;onRefresh?: () => void;}】",
12580+
"doc-url": "https://tdesign.tencent.com/vue-next/components/qrcode?tab=api#qrcode-props"
12581+
},
12582+
{
12583+
"name": "status-render",
12584+
"description": "Custom state renderer\n\n自定义状态渲染器类型和参数:(info:StatusRenderInfo) => TNode【type StatusRenderInfo = {status:QRStatus;onRefresh?: () => void;}】",
12585+
"doc-url": "https://tdesign.tencent.com/vue-next/components/qrcode?tab=api#qrcode-props"
12586+
}
12587+
]
12588+
},
1244112589
{
1244212590
"name": "t-radio",
1244312591
"source": {

0 commit comments

Comments
 (0)