Skip to content

Commit d9c5490

Browse files
novlan1tdesign-bot
andauthored
fix: 修复switch类型报错 (#4553)
* fix: 修复switch类型报错 * docs: update uniapp docs * chore: stash changelog [ci skip] --------- Co-authored-by: tdesign-bot <tdesign@tencent.com>
1 parent ac71663 commit d9c5490

12 files changed

Lines changed: 26 additions & 20 deletions

File tree

packages/components/switch/README.en-US.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ name | type | default | description | required
88
-- | -- | -- | -- | --
99
style | Object | - | CSS(Cascading Style Sheets) | N
1010
custom-style | Object | - | CSS(Cascading Style Sheets),used to set style on virtual component | N
11-
custom-value | Array | [true, false] | Typescript`Array<SwitchValue>` | N
11+
custom-value | Array | [true, false] | Typescript: `Array<SwitchValue>` | N
1212
disabled | Boolean | undefined | \- | N
13-
icon | Array | [] | `0.27.0`。Typescript`string[]` | N
14-
label | Array | [] | `0.27.0`。Typescript`string[]` | N
13+
icon | Array | [] | `0.27.0`。Typescript: `string[]` | N
14+
label | Array | [] | `0.27.0`。Typescript: `string[]` | N
1515
loading | Boolean | false | `0.27.0` | N
1616
size | String | medium | `0.27.0`。options: small/medium/large | N
17-
value | String / Number / Boolean | null | Typescript`SwitchValue` `type SwitchValue = string \| number \| boolean`[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/packages/components/switch/type.ts) | N
18-
default-value | String / Number / Boolean | undefined | uncontrolled property。Typescript`SwitchValue` `type SwitchValue = string \| number \| boolean`[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/packages/components/switch/type.ts) | N
17+
value | String / Number / Boolean | null | Typescript: `SwitchValue` `type SwitchValue = string \| number \| boolean`[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/packages/components/switch/type.ts) | N
18+
default-value | String / Number / Boolean | undefined | uncontrolled property。Typescript: `SwitchValue` `type SwitchValue = string \| number \| boolean`[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/packages/components/switch/type.ts) | N
1919

2020
### Switch Events
2121

packages/components/switch/type.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC
55
* */
66

7-
export interface TdSwitchProps<T = SwitchValue> {
7+
export interface TdSwitchProps {
88
/**
99
* 用于自定义开关的值,[打开时的值,关闭时的值]。默认为 [true, false]。示例:[1, 0]、['open', 'close']
1010
* @default [true, false]

packages/tdesign-uniapp-chat/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333

3434
扫码查看 ↓
3535

36-
<img src="https://tdesign.gtimg.com/uniapp/example-qrcode.png" width="600" />
36+
<img src="https://tdesign.gtimg.com/uniapp/example-qrcode.png" width="700" />
3737

3838
> 其他平台同样支持,仅因平台审核等原因未能上架预览,不影响组件库正常使用。
3939

packages/tdesign-uniapp-chat/site/docs/getting-started.en-US.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ spline: explain
1515

1616
Scan the QR code to preview ↓
1717

18-
<img src="https://tdesign.gtimg.com/uniapp/example-qrcode.png" width="600" />
18+
<img src="https://tdesign.gtimg.com/uniapp/example-qrcode.png" width="700" />
1919

2020
> Other platforms are also supported. Due to platform review and other reasons, previews may not be available, but this does not affect the normal use of the component library.
2121

packages/tdesign-uniapp-chat/site/docs/getting-started.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ spline: explain
1515

1616
扫码查看 ↓
1717

18-
<img src="https://tdesign.gtimg.com/uniapp/example-qrcode.png" width="600" />
18+
<img src="https://tdesign.gtimg.com/uniapp/example-qrcode.png" width="700" />
1919

2020
> 其他平台同样支持,仅因平台审核等原因未能上架预览,不影响组件库正常使用。
2121
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
pr_number: 4553
3+
contributor: novlan1
4+
---
5+
6+
- fix(Switch): 修复 `TdSwitchProps` 泛型参数导致 TypeScript 类型报错的问题 @novlan1 ([#4553](https://github.com/Tencent/tdesign-miniprogram/pull/4553))

packages/tdesign-uniapp/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333

3434
扫码查看 ↓
3535

36-
<img src="https://tdesign.gtimg.com/uniapp/example-qrcode.png" width="600" />
36+
<img src="https://tdesign.gtimg.com/uniapp/example-qrcode.png" width="700" />
3737

3838
> 其他平台同样支持,仅因平台审核等原因未能上架预览,不影响组件库正常使用。
3939

packages/tdesign-uniapp/site/docs/getting-started.en-US.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ spline: explain
1515

1616
Scan the QR code to preview ↓
1717

18-
<img src="https://tdesign.gtimg.com/uniapp/example-qrcode.png" width="600" />
18+
<img src="https://tdesign.gtimg.com/uniapp/example-qrcode.png" width="700" />
1919

2020
> Other platforms are also supported. Due to platform review and other reasons, previews may not be available, but this does not affect the normal use of the component library.
2121

packages/tdesign-uniapp/site/docs/getting-started.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ spline: explain
1515

1616
扫码查看 ↓
1717

18-
<img src="https://tdesign.gtimg.com/uniapp/example-qrcode.png" width="600" />
18+
<img src="https://tdesign.gtimg.com/uniapp/example-qrcode.png" width="700" />
1919

2020
> 其他平台同样支持,仅因平台审核等原因未能上架预览,不影响组件库正常使用。
2121

packages/uniapp-components/switch/README.en-US.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77
name | type | default | description | required
88
-- | -- | -- | -- | --
99
custom-style | Object | - | CSS(Cascading Style Sheets) | N
10-
custom-value | Array | [true, false] | Typescript`Array<SwitchValue>` | N
10+
custom-value | Array | [true, false] | Typescript: `Array<SwitchValue>` | N
1111
disabled | Boolean | undefined | \- | N
12-
icon | Array | [] | Typescript`string[]` | N
13-
label | Array | [] | Typescript`string[]` | N
12+
icon | Array | [] | Typescript: `string[]` | N
13+
label | Array | [] | Typescript: `string[]` | N
1414
loading | Boolean | false | \- | N
1515
size | String | medium | options: small/medium/large | N
16-
value | String / Number / Boolean | - | `v-model:value` is supported。Typescript`SwitchValue` `type SwitchValue = string \| number \| boolean`[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/packages/uniapp-components/switch/type.ts) | N
17-
default-value | String / Number / Boolean | - | uncontrolled property。Typescript`SwitchValue` `type SwitchValue = string \| number \| boolean`[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/packages/uniapp-components/switch/type.ts) | N
16+
value | String / Number / Boolean | - | `v-model:value` is supported。Typescript: `SwitchValue` `type SwitchValue = string \| number \| boolean`[see more ts definition](https://github.com/tencent/tdesign-miniprogram/blob/develop/packages/uniapp-components/switch/type.ts) | N
17+
default-value | String / Number / Boolean | - | uncontrolled property。Typescript: `SwitchValue` `type SwitchValue = string \| number \| boolean`[see more ts definition](https://github.com/tencent/tdesign-miniprogram/blob/develop/packages/uniapp-components/switch/type.ts) | N
1818

1919
### Switch Events
2020

0 commit comments

Comments
 (0)