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
useVModel
break with vue 2.7 and vue-demi
#1745
Comments
b4n92uid
changed the title
Jul 4, 2022
useVModel
break with vue 2.7useVModel
break with vue 2.7 and vue-demi
Looks good, PR welcome |
I create a PR #1798 |
Problem not resolved Error: console.log(vm?.proxy?.emit) // undefined Fixed: console.log(vm?.proxy?.$emit) |
9 tasks
I used the latest version(v8.9.2) but it still doesn't work. Maybe @Staremang's PR can fix that. Could you please review and merge it? Thanks! @antfu |
antfu
pushed a commit
that referenced
this issue
Jul 14, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
Hello everyone, first thanks for the incredible toolset of composables function
So useVModel is trying to get the emit function directly from the VM :
vueuse/packages/core/useVModel/index.ts
Line 57 in ef6cf56
const _emit = emit || vm?.emit || vm?.$emit?.bind(vm)
And as stated here by the vue author we should not rely on other than proxy to use the current instance:
vuejs/vue#12596 (comment)
So this can be refactored as (in backward compatible manner):
const _emit = emit || vm?.emit || vm?.$emit?.bind(vm) || vm?.proxy?.emit
Reproduction
N/A
System Info
Used Package Manager
yarn
Validations
The text was updated successfully, but these errors were encountered: