Skip to content

Commit ef4f163

Browse files
authored
fix(2.7): correct source for hasInjectionContext (#229)
1 parent 5c274bf commit ef4f163

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

lib/v2.7/index.cjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,4 @@ Object.keys(VueModule).forEach(function (key) {
5555
})
5656

5757
// Not implemented https://github.com/vuejs/core/pull/8111, falls back to getCurrentInstance()
58-
exports.hasInjectionContext = () => !!VueCompositionAPI.getCurrentInstance()
58+
exports.hasInjectionContext = () => !!VueModule.getCurrentInstance()

lib/v2.7/index.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import Vue from 'vue'
2+
import { getCurrentInstance } from 'vue'
23

34
var isVue2 = true
45
var isVue3 = false
@@ -75,5 +76,5 @@ export * from 'vue'
7576

7677
// Not implemented https://github.com/vuejs/core/pull/8111, falls back to getCurrentInstance()
7778
export function hasInjectionContext() {
78-
return !!VueCompositionAPI.getCurrentInstance()
79+
return !!getCurrentInstance()
7980
}

0 commit comments

Comments
 (0)