mirror of
https://github.com/youzan/vant.git
synced 2025-10-19 10:07:07 +00:00
[improvement] Overlay: functional & tsx (#2822)
This commit is contained in:
@@ -58,12 +58,15 @@ export function emit(context: Context, eventName: string, ...args: any[]) {
|
||||
}
|
||||
|
||||
// mount functional component
|
||||
export function mount(Component: any) {
|
||||
export function mount(Component: any, data?: VNodeData) {
|
||||
const instance = new Vue({
|
||||
el: document.createElement('div'),
|
||||
props: Component.props,
|
||||
render(h) {
|
||||
return h(Component, { props: this.$props });
|
||||
return h(Component, {
|
||||
props: this.$props,
|
||||
...data
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user