Closed codebykyle closed 3 years ago
Hello, thank you for taking time filling this issue!
However, we kindly ask you to use our Issue Helper when creating new issues, in order to ensure every issue provides the necessary information for us to investigate. This explains why your issue has been automatically closed by me (your robot friend!).
I hope to see your helper-created issue very soon!
Hello all,
I am receiving the following error when trying to build a library: Error: v-model can only be used on ,
The error is the following: rollup-plugin-vue\dist\template.js:18:23
I am unsure if there is a way to get past this error
Here is a link to reproduce it, although, this example is not the best: https://sfc.vuejs.org/#eyJBcHAudnVlIjoiPHNjcmlwdCBzZXR1cD5cbmltcG9ydCB7IHJlZiB9IGZyb20gJ3Z1ZSdcblxuY29uc3QgbXNnID0gcmVmKCdIZWxsbyBXb3JsZCEnKVxuPC9zY3JpcHQ+XG5cbjx0ZW1wbGF0ZT5cbiAgPGgxPnt7IG1zZyB9fTwvaDE+XG4gIDxpbnB1dCB2LW1vZGVsPVwibXNnXCI+XG4gIDxpbWcgdi1tb2RlbD1cIm1zZ1wiIC8+XG48L3RlbXBsYXRlPiAiLCJpbXBvcnQtbWFwLmpzb24iOiJ7XG4gIFwiaW1wb3J0c1wiOiB7XG4gICAgXCJ2dWVcIjogXCJodHRwczovL3NmYy52dWVqcy5vcmcvdnVlLnJ1bnRpbWUuZXNtLWJyb3dzZXIuanNcIlxuICB9XG59In0=
The expected behavior:
VueJS allows you to use v-model on any element which implements the
:value
data binding and emits the@input
event.You can find this in the official documentation for custom components here: https://vuejs.org/v2/guide/forms.html
And here: https://vuejs.org/v2/guide/components.html#Using-v-model-on-Components
The current implementation does not allow for this
The resulting behavior
The resulting behavior is that any component which implements the above pattern results in an error which cannot be built
Requested Changes
I believe there should not be a check on v-model on components. HTML element can support v-model provided it accepts a value emits an event, per the Vue2 documentation. It is possible there is something I am missing here, if so, any advice would be appreciated.
Thank you