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 authored 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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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.