Skip to content

Commit c98a26b

Browse files
Teaghyhguan
andauthored
fix(<2.7): hasInjectionContext error (#232)
Co-authored-by: hguan <hguan@pisx.com>
1 parent 3f82ddd commit c98a26b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/v2/index.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import Vue from 'vue'
2-
import VueCompositionAPI from '@vue/composition-api/dist/vue-composition-api.mjs'
2+
import VueCompositionAPI, { getCurrentInstance } from '@vue/composition-api/dist/vue-composition-api.mjs'
33

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

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

0 commit comments

Comments
 (0)