diff --git a/src/composition/use-placeholder.js b/src/composition/use-placeholder.js deleted file mode 100644 index fdff8caa5..000000000 --- a/src/composition/use-placeholder.js +++ /dev/null @@ -1,14 +0,0 @@ -import { useHeight } from './use-rect'; - -export function usePlaceholder(contentRef, bem) { - const height = useHeight(contentRef); - - return (renderContent) => ( -
- {renderContent()} -
- ); -} diff --git a/src/composition/use-placeholder.tsx b/src/composition/use-placeholder.tsx new file mode 100644 index 000000000..02e5727e6 --- /dev/null +++ b/src/composition/use-placeholder.tsx @@ -0,0 +1,16 @@ +import { useHeight } from './use-rect'; +import type { Ref, VNode } from 'vue'; +import type { BEM } from '../utils/create/bem'; + +export function usePlaceholder(contentRef: Ref, bem: BEM) { + const height = useHeight(contentRef); + + return (renderContent: () => VNode) => ( +
+ {renderContent()} +
+ ); +}