Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions src/vueWrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,18 @@ function createVMProxy<T extends ComponentPublicInstance>(
): T {
return new Proxy(vm, {
get(vm, key, receiver) {
if (vm.$.exposed && vm.$.exposeProxy && key in vm.$.exposeProxy) {
// first if the key is exposed
return Reflect.get(vm.$.exposeProxy, key, receiver)
if (vm.$.exposeProxy && key in vm.$.exposeProxy) {
// first if the key is exposed in exposeProxy
return Reflect.get(vm.$.exposeProxy, key, receiver);
}
else if (vm.$.exposed && key in vm.$.exposed) {
// second if the key is exposed
return Reflect.get(proxyRefs(vm.$.exposed), key, receiver);
} else if (key in setupState) {
// second if the key is acccessible from the setupState
// third if the key is acccessible from the setupState
return Reflect.get(setupState, key, receiver)
} else if (key in vm.$.appContext.config.globalProperties) {
// third if the key is a global property
// fourth if the key is a global property
return Reflect.get(
vm.$.appContext.config.globalProperties,
key,
Expand Down