Skip to content

Commit

Permalink
refactor: fix type issues
Browse files Browse the repository at this point in the history
  • Loading branch information
posva committed May 25, 2020
1 parent a0d10f9 commit d5265f6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion __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({
Expand Down
5 changes: 4 additions & 1 deletion 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'
Expand All @@ -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)
Expand Down

0 comments on commit d5265f6

Please sign in to comment.