Skip to content

使用基于模板的函数式组件时,v-model和.sync 会报 TypeError: _vm.$set is not a function #12260

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

Closed
zijjj opened this issue Sep 8, 2021 · 1 comment

Comments

@zijjj
Copy link

zijjj commented Sep 8, 2021

Version

2.6.14

Reproduction link

codesandbox.io

Steps to reproduce

打开链接 直接在页面中的 输入框输入内容即可复现该错误

What is expected?

name 的值应该正确的被设置

What is actually happening?

报错 TypeError: _vm.$set is not a function
我发现是因为 _vm 没有 $set 方法导致的,此时 _vm.$set 如果被渲染成 _vm.injections.rootNode.$set 就没有问题了

@posva
Copy link
Member

posva commented Sep 8, 2021

Duplicate of vuejs/vue-loader#1539

@posva posva marked this as a duplicate of vuejs/vue-loader#1539 Sep 8, 2021
@posva posva closed this as completed Sep 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants