From 3fc3dd3f6b59cc4527f87c9b2a250dddb0397e1e Mon Sep 17 00:00:00 2001 From: neverland Date: Thu, 30 Sep 2021 17:53:29 +0800 Subject: [PATCH] types(Skeleton): add SkeletonAvatarShape type (#9605) --- packages/vant/src/skeleton/README.md | 8 ++++++++ packages/vant/src/skeleton/README.zh-CN.md | 8 ++++++++ packages/vant/src/skeleton/index.ts | 3 ++- 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/packages/vant/src/skeleton/README.md b/packages/vant/src/skeleton/README.md index c7dd33b82..59e94677e 100644 --- a/packages/vant/src/skeleton/README.md +++ b/packages/vant/src/skeleton/README.md @@ -73,6 +73,14 @@ export default { | avatar-size | Size of avatar placeholder | _number \| string_ | `32px` | | avatar-shape | Shape of avatar placeholder,can be set to `square` | _string_ | `round` | +### Types + +The component exports the following type definitions: + +```ts +import type { SkeletonAvatarShape } from 'vant'; +``` + ## Theming ### CSS Variables diff --git a/packages/vant/src/skeleton/README.zh-CN.md b/packages/vant/src/skeleton/README.zh-CN.md index 6e0a3b9f8..532cb1779 100644 --- a/packages/vant/src/skeleton/README.zh-CN.md +++ b/packages/vant/src/skeleton/README.zh-CN.md @@ -79,6 +79,14 @@ export default { | avatar-size | 头像占位图大小 | _number \| string_ | `32px` | | avatar-shape | 头像占位图形状,可选值为 `square` | _string_ | `round` | +### 类型定义 + +组件导出以下类型定义: + +```ts +import type { SkeletonAvatarShape } from 'vant'; +``` + ## 主题定制 ### 样式变量 diff --git a/packages/vant/src/skeleton/index.ts b/packages/vant/src/skeleton/index.ts index 0c1228482..d4f86f5a6 100644 --- a/packages/vant/src/skeleton/index.ts +++ b/packages/vant/src/skeleton/index.ts @@ -1,5 +1,6 @@ import { withInstall } from '../utils'; -import _Skeleton from './Skeleton'; +import _Skeleton, { SkeletonAvatarShape } from './Skeleton'; export const Skeleton = withInstall(_Skeleton); export default Skeleton; +export type { SkeletonAvatarShape };