Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(iife): add hasInjectionContext #225

Merged
merged 1 commit into from May 17, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions lib/index.iife.js
Expand Up @@ -19,6 +19,7 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
VueDemi.Vue2 = Vue
VueDemi.version = Vue.version
VueDemi.warn = Vue.util.warn
VueDime.hasInjectionContext = () => !!VueDemi.getCurrentInstance()
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there is a typo in your variable, repeated on the second line change

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I created #227. In this kind of cases, it's even better if you can directly create the PR @noook 😄

function createApp(rootComponent, rootProps) {
var vm
var provide = {}
Expand Down Expand Up @@ -71,6 +72,7 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
VueDemi.Vue = Vue
VueDemi.Vue2 = Vue
VueDemi.version = Vue.version
VueDime.hasInjectionContext = () => !!VueDemi.getCurrentInstance()
} else {
console.error('[vue-demi] no VueCompositionAPI instance found, please be sure to import `@vue/composition-api` before `vue-demi`.')
}
Expand Down