chore(Popup): useLazyRender

This commit is contained in:
chenjiahan
2020-09-14 20:05:45 +08:00
parent 9465653f42
commit 708c37c759
2 changed files with 15 additions and 23 deletions
+3 -3
View File
@@ -1,7 +1,7 @@
import { ref, Ref, watch } from 'vue';
import { ref, isRef, watch, WatchSource } from 'vue';
export function useLazyRender(show: Ref<boolean>) {
const inited = ref(show.value);
export function useLazyRender(show: WatchSource<boolean>) {
const inited = ref(isRef(show) ? show.value : show());
watch(show, (value) => {
if (value) {