Skip to content

Commit

Permalink
refactor(grid): update type
Browse files Browse the repository at this point in the history
  • Loading branch information
novlan1 committed Jan 15, 2025
1 parent 75f4d30 commit 536f245
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/grid/grid-item-props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ export default {
description: {
type: [String, Function] as PropType<TdGridItemProps['description']>,
},
/** 图标名称。值为字符串表示图标名称,值为 `Object` 类型,表示透传至 `icon` */
/** 图标名称。 */
icon: {
type: [String, Object] as PropType<TdGridItemProps['icon']>,
type: Function as PropType<TdGridItemProps['icon']>,
},
/** 图片,可以是图片地址,也可以自定义图片节点,如果传入对象则透传至 image 组件 */
image: {
Expand Down
2 changes: 1 addition & 1 deletion src/grid/grid.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ name | type | default | description | required
-- | -- | -- | -- | --
badge | Object | null | Typescript:`BadgeProps`[Badge API Documents](./badge?tab=api)[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/grid/type.ts) | N
description | String / Slot / Function | - | Typescript:`string \| TNode`[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N
icon | String / Object | - | \- | N
icon | Slot / Function | - | Typescript:`TNode`[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N
image | String / Object / Slot / Function | - | Typescript:`string \| object \| TNode`[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N
layout | String | vertical | options: vertical/horizontal | N
text | String / Slot / Function | - | Typescript:`string \| TNode`[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N
Expand Down
2 changes: 1 addition & 1 deletion src/grid/grid.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ theme | String | default | 宫格的风格。可选项:default/card | N
-- | -- | -- | -- | --
badge | Object | null | 透传至 Badge 属性。TS 类型:`BadgeProps`[Badge API Documents](./badge?tab=api)[详细类型定义](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/grid/type.ts) | N
description | String / Slot / Function | - | 文本以外的更多描述,辅助信息。可以通过 Props 传入文本,也可以自定义标题节点。TS 类型:`string \| TNode`[通用类型定义](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N
icon | String / Object | - | 图标名称。值为字符串表示图标名称,值为 `Object` 类型,表示透传至 `icon` | N
icon | Slot / Function | - | 图标名称。。TS 类型:`TNode`[通用类型定义](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N
image | String / Object / Slot / Function | - | 图片,可以是图片地址,也可以自定义图片节点,如果传入对象则透传至 image 组件。TS 类型:`string \| object \| TNode`[通用类型定义](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N
layout | String | vertical | 内容布局方式。可选项:vertical/horizontal | N
text | String / Slot / Function | - | 文本,可以通过 Props 传入文本,也可以自定义标题节点。TS 类型:`string \| TNode`[通用类型定义](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N
Expand Down
4 changes: 2 additions & 2 deletions src/grid/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ export interface TdGridItemProps {
*/
description?: string | TNode;
/**
* 图标名称。值为字符串表示图标名称,值为 `Object` 类型,表示透传至 `icon`
* 图标名称。
*/
icon?: string | object;
icon?: TNode;
/**
* 图片,可以是图片地址,也可以自定义图片节点,如果传入对象则透传至 image 组件
*/
Expand Down

0 comments on commit 536f245

Please sign in to comment.