From ef4f1631da90d50624ddf8bab24d184ec653837d Mon Sep 17 00:00:00 2001 From: Eduardo San Martin Morote Date: Wed, 17 May 2023 17:32:51 +0200 Subject: [PATCH] fix(2.7): correct source for hasInjectionContext (#229) --- lib/v2.7/index.cjs | 2 +- lib/v2.7/index.mjs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/v2.7/index.cjs b/lib/v2.7/index.cjs index 9813c17..1dce010 100644 --- a/lib/v2.7/index.cjs +++ b/lib/v2.7/index.cjs @@ -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() diff --git a/lib/v2.7/index.mjs b/lib/v2.7/index.mjs index 80eb810..e575059 100644 --- a/lib/v2.7/index.mjs +++ b/lib/v2.7/index.mjs @@ -1,4 +1,5 @@ import Vue from 'vue' +import { getCurrentInstance } from 'vue' var isVue2 = true var isVue3 = false @@ -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() }