mirror of
https://github.com/IT4Change/boilerplate-frontend.git
synced 2025-12-13 07:35:53 +00:00
delete component type, clean types in app.ts
This commit is contained in:
parent
b4115348ba
commit
9504eed56b
@ -1,5 +1,5 @@
|
||||
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'
|
||||
import { createSSRApp, defineComponent, h, markRaw, reactive } from 'vue'
|
||||
import { createSSRApp, defineComponent, h, markRaw, reactive, Component } from 'vue'
|
||||
|
||||
import PageShell from '#components/PageShell.vue'
|
||||
import { setPageContext } from '#context/usePageContext'
|
||||
@ -7,13 +7,13 @@ import i18n from '#plugins/i18n'
|
||||
import pinia from '#plugins/pinia'
|
||||
import CreateVuetify from '#plugins/vuetify'
|
||||
|
||||
import type { Component } from '#types/Component'
|
||||
import type { PageContext, VikePageContext } from '#types/PageContext'
|
||||
|
||||
const vuetify = CreateVuetify(i18n)
|
||||
|
||||
function createApp(pageContext: VikePageContext & PageContext, isClient = true) {
|
||||
let rootComponent: Component
|
||||
// eslint-disable-next-line no-use-before-define
|
||||
let rootComponent: InstanceType<typeof PageWithWrapper>
|
||||
const PageWithWrapper = defineComponent({
|
||||
data: () => ({
|
||||
Page: markRaw(pageContext.Page),
|
||||
@ -26,7 +26,7 @@ function createApp(pageContext: VikePageContext & PageContext, isClient = true)
|
||||
},
|
||||
render() {
|
||||
return h(
|
||||
PageShell,
|
||||
PageShell as Component,
|
||||
{},
|
||||
{
|
||||
default: () => {
|
||||
@ -49,9 +49,7 @@ function createApp(pageContext: VikePageContext & PageContext, isClient = true)
|
||||
objectAssign(app, {
|
||||
changePage: (pageContext: VikePageContext & PageContext) => {
|
||||
Object.assign(pageContextReactive, pageContext)
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
||||
rootComponent.Page = markRaw(pageContext.Page)
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
||||
rootComponent.pageProps = markRaw(pageContext.pageProps || {})
|
||||
},
|
||||
})
|
||||
|
||||
@ -1,2 +0,0 @@
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
export type Component = any
|
||||
Loading…
x
Reference in New Issue
Block a user