Skip to content

Commit

Permalink
fix(<2.7): hasInjectionContext error (#232)
Browse files Browse the repository at this point in the history
Co-authored-by: hguan <hguan@pisx.com>
  • Loading branch information
Teaghy and hguan committed May 18, 2023
1 parent 3f82ddd commit c98a26b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/v2/index.mjs
@@ -1,5 +1,5 @@
import Vue from 'vue'
import VueCompositionAPI from '@vue/composition-api/dist/vue-composition-api.mjs'
import VueCompositionAPI, { getCurrentInstance } from '@vue/composition-api/dist/vue-composition-api.mjs'

function install(_vue) {
_vue = _vue || Vue
Expand Down Expand Up @@ -45,5 +45,5 @@ export var KeepAlive = /*#__PURE__*/ createMockComponent('KeepAlive')

// Not implemented https://github.com/vuejs/core/pull/8111, falls back to getCurrentInstance()
export function hasInjectionContext() {
return !!VueCompositionAPI.getCurrentInstance()
return !!getCurrentInstance()
}

0 comments on commit c98a26b

Please sign in to comment.