From d5265f6c10177068386f90d6cc796c28a7c32b4f Mon Sep 17 00:00:00 2001 From: Eduardo San Martin Morote Date: Mon, 25 May 2020 14:35:49 +0200 Subject: [PATCH] refactor: fix type issues --- __tests__/ssr/app/App.ts | 5 ++++- src/ssrPlugin.ts | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/__tests__/ssr/app/App.ts b/__tests__/ssr/app/App.ts index 5699a4d2..4d094cc6 100644 --- a/__tests__/ssr/app/App.ts +++ b/__tests__/ssr/app/App.ts @@ -1,4 +1,7 @@ -import { defineComponent, computed } from '@vue/composition-api' +import { + createComponent as defineComponent, + computed, +} from '@vue/composition-api' import { useStore } from './store' export default defineComponent({ diff --git a/src/ssrPlugin.ts b/src/ssrPlugin.ts index 838b4cff..6cda44ca 100644 --- a/src/ssrPlugin.ts +++ b/src/ssrPlugin.ts @@ -1,5 +1,6 @@ import { VueConstructor } from 'vue/types' import { setActiveReq } from './rootStore' +import { SetupContext } from '@vue/composition-api' export const PiniaSsr = (vue: VueConstructor) => { const isServer = typeof window === 'undefined' @@ -13,9 +14,11 @@ export const PiniaSsr = (vue: VueConstructor) => { vue.mixin({ beforeCreate() { + // @ts-ignore const { setup, serverPrefetch } = this.$options if (setup) { - this.$options.setup = (props, context) => { + // @ts-ignore + this.$options.setup = (props: any, context: SetupContext) => { // @ts-ignore setActiveReq(context.ssrContext.req) return setup(props, context) -- 2.47.3