mirror of
https://github.com/youzan/vant.git
synced 2025-10-19 10:07:07 +00:00
chore: rename composables folder
This commit is contained in:
16
src/composables/use-placeholder.tsx
Normal file
16
src/composables/use-placeholder.tsx
Normal file
@@ -0,0 +1,16 @@
|
||||
import { useHeight } from './use-height';
|
||||
import type { Ref } from 'vue';
|
||||
import type { BEM } from '../utils/create/bem';
|
||||
|
||||
export function usePlaceholder(contentRef: Ref<Element>, bem: BEM) {
|
||||
const height = useHeight(contentRef);
|
||||
|
||||
return (renderContent: () => JSX.Element) => (
|
||||
<div
|
||||
class={bem('placeholder')}
|
||||
style={{ height: height.value ? `${height.value}px` : undefined }}
|
||||
>
|
||||
{renderContent()}
|
||||
</div>
|
||||
);
|
||||
}
|
Reference in New Issue
Block a user