feat: 微客宝H5客户端 - 基础架构+核心页面

This commit is contained in:
li
2026-03-14 19:44:03 +08:00
parent 54d2f617bb
commit 0e974da09c
3738 changed files with 811180 additions and 21 deletions
+39
View File
@@ -0,0 +1,39 @@
import { createApp, reactive } from "vue";
import { extend } from "./basic.mjs";
import { useExpose } from "../composables/use-expose.mjs";
function usePopupState() {
const state = reactive({
show: false
});
const toggle = (show) => {
state.show = show;
};
const open = (props) => {
extend(state, props, { transitionAppear: true });
toggle(true);
};
const close = () => toggle(false);
useExpose({ open, close, toggle });
return {
open,
close,
state,
toggle
};
}
function mountComponent(RootComponent) {
const app = createApp(RootComponent);
const root = document.createElement("div");
document.body.appendChild(root);
return {
instance: app.mount(root),
unmount() {
app.unmount();
document.body.removeChild(root);
}
};
}
export {
mountComponent,
usePopupState
};