Skip to content

Commit

Permalink
chore: align with PC (#389)
Browse files Browse the repository at this point in the history
Co-authored-by: anlyyao <[email protected]>
  • Loading branch information
anlyyao and anlyyao authored Aug 22, 2024
1 parent 120655b commit b99a885
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 42 deletions.
Binary file modified db/TDesign.db
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ image | String | - | images url | N
imageProps | Object | - | Typescript:`ImageProps`[Image API Documents](./image?tab=api)[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/avatar/type.ts) | N
shape | String | circle | shape。options: circle/round。Typescript:`ShapeEnum ` `type ShapeEnum = 'circle' \| 'round'`[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/avatar/type.ts) | N
size | String | medium | size | N
onError | Function | | Typescript:`(context: { e: ImageEvent }) => void`<br/>trigger on image load failed | N
onError | Function | | Typescript:`(context: { e: Event }) => void`<br/>trigger on image load failed | N

### Avatar Events

name | params | description
-- | -- | --
error | `(context: { e: ImageEvent })` | trigger on image load failed
error | `(context: { e: Event })` | trigger on image load failed


### AvatarGroup Props
Expand Down
4 changes: 2 additions & 2 deletions packages/products/tdesign-mobile-vue/src/avatar/avatar.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ image | String | - | 图片地址 | N
imageProps | Object | - | 透传至 Image 组件。TS 类型:`ImageProps`[Image API Documents](./image?tab=api)[详细类型定义](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/avatar/type.ts) | N
shape | String | circle | 形状。可选项:circle/round。TS 类型:`ShapeEnum ` `type ShapeEnum = 'circle' \| 'round'`[详细类型定义](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/avatar/type.ts) | N
size | String | medium | 尺寸,示例值:small/medium/large/24px/38px 等。优先级高于 AvatarGroup.size 。Avatar 单独存在时,默认值为 medium。如果父组件存在 AvatarGroup,默认值便由 AvatarGroup.size 决定 | N
onError | Function | | TS 类型:`(context: { e: ImageEvent }) => void`<br/>图片加载失败时触发 | N
onError | Function | | TS 类型:`(context: { e: Event }) => void`<br/>图片加载失败时触发 | N

### Avatar Events

名称 | 参数 | 描述
-- | -- | --
error | `(context: { e: ImageEvent })` | 图片加载失败时触发
error | `(context: { e: Event })` | 图片加载失败时触发


### AvatarGroup Props
Expand Down
4 changes: 2 additions & 2 deletions packages/products/tdesign-mobile-vue/src/avatar/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import { BadgeProps } from '../badge';
import { ImageProps } from '../image';
import { TNode, ImageEvent } from '../common';
import { TNode } from '../common';

export interface TdAvatarProps {
/**
Expand Down Expand Up @@ -49,7 +49,7 @@ export interface TdAvatarProps {
/**
* 图片加载失败时触发
*/
onError?: (context: { e: ImageEvent }) => void;
onError?: (context: { e: Event }) => void;
}

export interface TdAvatarGroupProps {
Expand Down
41 changes: 5 additions & 36 deletions packages/scripts/api.json
Original file line number Diff line number Diff line change
Expand Up @@ -6514,8 +6514,10 @@
"1",
"2",
"4",
"8",
"16",
"32"
"32",
"64"
],
"component": "Avatar",
"field_category": 2,
Expand Down Expand Up @@ -6544,42 +6546,9 @@
"Vue(PC)",
"React(PC)",
"Angular(PC)",
"React(Mobile)",
"Angular(Mobile)"
],
"field_type_text": []
},
{
"id": 1712913934,
"platform_framework": [
"8",
"64"
],
"component": "Avatar",
"field_category": 2,
"field_name": "error",
"field_type": [],
"field_default_value": "",
"field_enum": "",
"field_desc_zh": "图片加载失败时触发",
"field_desc_en": "trigger on image load failed",
"field_required": 0,
"event_input": "(context: { e: ImageEvent })",
"create_time": "2024-04-12 09:25:34",
"update_time": "2024-04-12 09:25:34",
"event_output": null,
"custom_field_type": null,
"syntactic_sugar": null,
"readonly": 1,
"html_attribute": 0,
"trigger_elements": "ImageEvent<HTMLImageElement>",
"deprecated": 0,
"version": "",
"test_description": null,
"support_default_value": 0,
"field_category_text": "Events",
"platform_framework_text": [
"Vue(Mobile)",
"React(Mobile)",
"Angular(Mobile)",
"Miniprogram"
],
"field_type_text": []
Expand Down

0 comments on commit b99a885

Please sign in to comment.