Skip to content

Commit

Permalink
fix(2.7): correct source for hasInjectionContext (#229)
Browse files Browse the repository at this point in the history
  • Loading branch information
posva committed May 17, 2023
1 parent 5c274bf commit ef4f163
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/v2.7/index.cjs
Expand Up @@ -55,4 +55,4 @@ Object.keys(VueModule).forEach(function (key) {
})

// Not implemented https://github.com/vuejs/core/pull/8111, falls back to getCurrentInstance()
exports.hasInjectionContext = () => !!VueCompositionAPI.getCurrentInstance()
exports.hasInjectionContext = () => !!VueModule.getCurrentInstance()
3 changes: 2 additions & 1 deletion lib/v2.7/index.mjs
@@ -1,4 +1,5 @@
import Vue from 'vue'
import { getCurrentInstance } from 'vue'

var isVue2 = true
var isVue3 = false
Expand Down Expand Up @@ -75,5 +76,5 @@ export * from 'vue'

// 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 ef4f163

Please sign in to comment.