Skip to content

Commit

Permalink
delete component type, clean types in app.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
ulfgebhardt committed Dec 13, 2023
1 parent b411534 commit 9504eed
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
10 changes: 4 additions & 6 deletions renderer/app.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
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'
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),
Expand All @@ -26,7 +26,7 @@ function createApp(pageContext: VikePageContext & PageContext, isClient = true)
},
render() {
return h(
PageShell,
PageShell as Component,
{},
{
default: () => {
Expand All @@ -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 || {})
},
})
Expand Down
2 changes: 0 additions & 2 deletions types/Component.ts

This file was deleted.

0 comments on commit 9504eed

Please sign in to comment.