From 786877b6299072c0db93dd09c6f5e2e523a59e34 Mon Sep 17 00:00:00 2001 From: aibayanyu Date: Wed, 19 Apr 2023 08:16:23 +0800 Subject: [PATCH] chore: change --- components/button/loading-icon.tsx | 46 ++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 components/button/loading-icon.tsx diff --git a/components/button/loading-icon.tsx b/components/button/loading-icon.tsx new file mode 100644 index 0000000..ed2a741 --- /dev/null +++ b/components/button/loading-icon.tsx @@ -0,0 +1,46 @@ +import { defineComponent } from 'vue' +import { booleanType, someType, stringType } from '@v-c/utils' +import LoadingOutlined from '@ant-design/icons-vue/LoadingOutlined' + +export interface LoadingIconProps { + prefixCls: string + existIcon: boolean + loading?: boolean | object +} +export const loadingIconProps = { + prefixCls: stringType(), + existIcon: booleanType(), + loading: someType([Boolean, Object]) +} + +// const getCollapsedWidth = (): CSSProperties => ({ +// width: 0, +// opacity: 0, +// transform: 'scale(0)' +// }) +// +// const getRealWidth = (node: HTMLElement): CSSProperties => ({ +// width: node.scrollWidth, +// opacity: 1, +// transform: 'scale(1)' +// }) + +const LoadingIcon = defineComponent({ + name: 'LoadingIcon', + props: loadingIconProps, + setup(props) { + return () => { + const { existIcon, prefixCls } = props + // const visible = !!loading + if (existIcon) { + return ( + + + + ) + } + } + } +}) + +export default LoadingIcon