chore: rename composables folder

This commit is contained in:
chenjiahan
2020-11-16 11:41:46 +08:00
parent dc6330bcdc
commit 062cd546a9
60 changed files with 67 additions and 67 deletions
+17
View File
@@ -0,0 +1,17 @@
import { ref, watch, WatchSource } from 'vue';
export function useLazyRender(show: WatchSource<boolean | undefined>) {
const inited = ref(false);
watch(
show,
(value) => {
if (value) {
inited.value = value;
}
},
{ immediate: true }
);
return (render: () => JSX.Element) => () => (inited.value ? render() : null);
}