From: Eduardo San Martin Morote Date: Mon, 25 May 2020 12:35:49 +0000 (+0200) Subject: refactor: fix type issues X-Git-Tag: 0.0.6~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d5265f6c10177068386f90d6cc796c28a7c32b4f;p=thirdparty%2Fvuejs%2Fpinia.git refactor: fix type issues --- 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)