Skip to content

Commit

Permalink
fix getCurrentInstance in web
Browse files Browse the repository at this point in the history
  • Loading branch information
hiyuki committed Oct 20, 2023
1 parent cad6b8f commit 5643a44
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions packages/core/src/platform/export/index.web.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {
effectScope as vueEffectScope,
getCurrentScope as getCurrentVueScope,
getCurrentScope as vueGetCurrentScope,
getCurrentInstance as vueGetCurrentInstance,
onScopeDispose
} from 'vue'

Expand All @@ -27,9 +28,7 @@ export {
shallowRef,
triggerRef,
// computed
computed,
// instance
getCurrentInstance
computed
} from 'vue'

const noop = () => {
Expand All @@ -42,7 +41,13 @@ const fixEffectScope = (scope) => {
}

const effectScope = (detached) => fixEffectScope(vueEffectScope(detached))
const getCurrentScope = () => fixEffectScope(getCurrentVueScope())
const getCurrentScope = () => fixEffectScope(vueGetCurrentScope())
const getCurrentInstance = () => vueGetCurrentInstance()?.proxy

export {
// instance
getCurrentInstance
}

export {
// effectScope
Expand Down

0 comments on commit 5643a44

Please sign in to comment.