2023-12-30 05:29:53 +00:00
|
|
|
import { createSSRApp, h } from 'vue';
|
2024-01-25 02:07:26 +00:00
|
|
|
import VueVirtualScroller from 'vue-virtual-scroller';
|
2024-02-29 04:08:54 +00:00
|
|
|
import FloatingVue from 'floating-vue';
|
2023-12-31 02:02:03 +00:00
|
|
|
|
|
|
|
import { setPageContext } from './usePageContext.js';
|
2024-04-02 03:55:53 +00:00
|
|
|
import initClient from './init-client.js';
|
2023-12-30 05:29:53 +00:00
|
|
|
|
|
|
|
import '../assets/css/style.css';
|
|
|
|
|
|
|
|
import Container from './container.vue';
|
|
|
|
import Link from '../components/link/link.vue';
|
|
|
|
import Icon from '../components/icon/icon.vue';
|
|
|
|
|
|
|
|
function createApp(Page, pageProps, pageContext) {
|
|
|
|
const PageWithLayout = {
|
|
|
|
render() {
|
|
|
|
return h(
|
|
|
|
Container,
|
|
|
|
{},
|
|
|
|
{
|
|
|
|
default() {
|
|
|
|
return h(Page, pageProps || {});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
);
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
const app = createSSRApp(PageWithLayout);
|
|
|
|
|
|
|
|
setPageContext(app, pageContext);
|
|
|
|
|
|
|
|
app.provide('pageContext', pageContext);
|
|
|
|
|
2024-02-29 04:08:54 +00:00
|
|
|
app.use(FloatingVue);
|
2024-01-25 02:07:26 +00:00
|
|
|
app.use(VueVirtualScroller);
|
|
|
|
|
2023-12-30 05:29:53 +00:00
|
|
|
app.component('Link', Link);
|
|
|
|
app.component('Icon', Icon);
|
|
|
|
|
2024-04-02 03:55:53 +00:00
|
|
|
if (typeof window === 'object') {
|
|
|
|
initClient(pageContext);
|
|
|
|
}
|
|
|
|
|
2023-12-30 05:29:53 +00:00
|
|
|
return app;
|
|
|
|
}
|
|
|
|
|
|
|
|
export { createApp };
|