mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-09-01 21:59:45 +08:00
perf: using appear instead
This commit is contained in:
parent
a48caa7c98
commit
c3759b1c3f
@ -54,6 +54,10 @@ export default defineComponent({
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
return () => <Transition name="van-fade">{renderOverlay()}</Transition>;
|
return () => (
|
||||||
|
<Transition name="van-fade" appear>
|
||||||
|
{renderOverlay()}
|
||||||
|
</Transition>
|
||||||
|
);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { createApp, reactive, Component, nextTick } from 'vue';
|
import { createApp, reactive, Component } from 'vue';
|
||||||
import { extend } from '../utils';
|
import { extend } from '../utils';
|
||||||
import { useExpose } from '../composables/use-expose';
|
import { useExpose } from '../composables/use-expose';
|
||||||
|
|
||||||
@ -15,14 +15,11 @@ export function usePopupState() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const open = (props: Record<string, any>) => {
|
const open = (props: Record<string, any>) => {
|
||||||
extend(state, props);
|
extend(state, props, { transitionAppear: true });
|
||||||
// for transition
|
toggle(true);
|
||||||
nextTick(() => toggle(true));
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const close = () => {
|
const close = () => toggle(false);
|
||||||
nextTick(() => toggle(false));
|
|
||||||
};
|
|
||||||
|
|
||||||
useExpose({ open, close, toggle });
|
useExpose({ open, close, toggle });
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user