feat: add usePopupState

This commit is contained in:
chenjiahan
2020-08-31 19:59:19 +08:00
parent f0675d043a
commit 10355ed849
6 changed files with 84 additions and 96 deletions
-17
View File
@@ -1,5 +1,3 @@
import { createApp, Component } from 'vue';
export { addUnit, getSizeStyle } from './format/unit';
export { createNamespace } from './create';
@@ -42,18 +40,3 @@ export function pick(obj: Record<string, any>, keys: string[]) {
return ret;
}, {} as Record<string, any>);
}
export function mountComponent(RootComponent: Component) {
const app = createApp(RootComponent);
const root = document.createElement('div');
document.body.appendChild(root);
return {
instance: app.mount(root),
unmount() {
app.unmount(root);
document.body.removeChild(root);
},
};
}