2023-05-28 22:54:17 +00:00
|
|
|
import { createSSRApp, h } from 'vue';
|
|
|
|
import { createPinia } from 'pinia';
|
2023-06-25 21:50:08 +00:00
|
|
|
import FloatingVue from 'floating-vue';
|
|
|
|
|
2023-05-28 22:54:17 +00:00
|
|
|
import Container from './container.vue';
|
|
|
|
import { setPageContext } from './usePageContext';
|
|
|
|
|
|
|
|
import '../assets/css/style.css';
|
2023-06-25 21:50:08 +00:00
|
|
|
import 'floating-vue/dist/style.css';
|
2023-05-28 22:54:17 +00:00
|
|
|
|
|
|
|
function createApp(pageContext) {
|
|
|
|
const PageWithLayout = {
|
|
|
|
render() {
|
|
|
|
return h(Container, {}, {
|
|
|
|
default() {
|
|
|
|
return h(pageContext.Page, pageContext.pageData || {});
|
|
|
|
},
|
|
|
|
});
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
const app = createSSRApp(PageWithLayout);
|
|
|
|
const store = createPinia();
|
|
|
|
|
|
|
|
app.use(store);
|
2023-06-25 21:50:08 +00:00
|
|
|
app.use(FloatingVue);
|
2023-05-28 22:54:17 +00:00
|
|
|
|
|
|
|
// We make pageContext available from any Vue component
|
|
|
|
setPageContext(app, pageContext);
|
|
|
|
|
|
|
|
return { app, store };
|
|
|
|
}
|
|
|
|
|
|
|
|
export { createApp };
|