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

WATCH_ARRAY in @vue/compat is triggered by CoreModal.vue #390

Closed
codepainters opened this issue Oct 5, 2023 · 3 comments
Closed

WATCH_ARRAY in @vue/compat is triggered by CoreModal.vue #390

codepainters opened this issue Oct 5, 2023 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@codepainters
Copy link

Version

vue-final-modal: 4.4.5
vue: 3.3.4
@vue/compat: 3.3.4

What is Expected?

Warning-free execution.

What is actually happening?

This calll to watch() triggers a warning from @vue/compat:

watch(() => [props.zIndexFn, index.value], () => {
if (visible.value)
refreshZIndex(index.value)
})

Actually the warning is legit, as far as I udnerstand the Vue docs:

When you call watch() directly on a reactive object, it will implicitly create a deep watcher - the callback will be triggered on all nested mutations.
This should be differentiated with a getter that returns a reactive object - in the latter case, the callback will only fire if the getter returns a different object.

@codepainters codepainters added the bug Something isn't working label Oct 5, 2023
@hunterliu1003
Copy link
Member

@codepainters
I am not familiar of what is @vue/compat doing. Can you provide a minimal reproduction?

@codepainters
Copy link
Author

Basically @vue/compat shows warnings for anything that might need taking care of when transitioning from Vue 2 to Vue 3 (which is what we are doing now).

I'll try to find some time to isolate it.

hunterliu1003 added a commit that referenced this issue Nov 29, 2023
hunterliu1003 added a commit that referenced this issue Nov 29, 2023
hunterliu1003 added a commit that referenced this issue Dec 7, 2023
@joonas-erho
Copy link

@hunterliu1003 This issue persists in version 4.5.4 when using @vue/compat. I believe it could be fixed by adding the deep: true property to the watcher in question.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants