From 9b5a07220bcec448c0484e86a21e39c2edd849fc Mon Sep 17 00:00:00 2001 From: tangjinzhou <415800467@qq.com> Date: Thu, 2 Feb 2023 22:16:55 +0800 Subject: [PATCH] refactor: popover & popconfirm --- components/_util/type.ts | 8 ++ components/popconfirm/demo/placement.vue | 2 +- components/popconfirm/index.en-US.md | 11 +- components/popconfirm/index.tsx | 125 +++++++++++------------ components/popconfirm/index.zh-CN.md | 13 +-- components/popover/index.tsx | 23 +++-- 6 files changed, 98 insertions(+), 84 deletions(-) diff --git a/components/_util/type.ts b/components/_util/type.ts index 86b366fe4..e1fac7566 100644 --- a/components/_util/type.ts +++ b/components/_util/type.ts @@ -55,6 +55,14 @@ export function booleanType(defaultVal?: any) { return { type: Boolean, default: defaultVal as boolean }; } +export function anyType() { + return { validator: () => true } as unknown as { type: PropType }; +} + +export function stringType(defaultVal?: string) { + return { type: String as unknown as PropType, default: defaultVal as T }; +} + export function someType(types: any[], defaultVal?: any) { return { type: types as PropType, default: defaultVal as T }; } diff --git a/components/popconfirm/demo/placement.vue b/components/popconfirm/demo/placement.vue index 0ae93cd9b..4aa7f7304 100644 --- a/components/popconfirm/demo/placement.vue +++ b/components/popconfirm/demo/placement.vue @@ -133,7 +133,7 @@ export default defineComponent({ });