v-model argument is not supported on plain elements 和 ‘v-model‘ directives require no argument.

洛茄

关注

阅读 213

2022-01-23

好久没写VUE,再写的时候踩了个小坑:

<input type=“text” v-model:value="value"/>

如果你开启了Eslint , 报错应该是

 'v-model' directives require no argument. 

我去查了下,大概说的是是eslint对vetur插件的检查出现的问题。但其实根本不是,如果你关闭了Eslint,会发现仍然报错:

 VueCompilerError: v-model argument is not supported on plain elements.

对于input标签来说,其实是V-model默认绑定的就是value,所以不需要再写一个value

那么修改方法很简单:把v-model后面那个value去掉

<input type=“text” v-model="value"/>

精彩评论(0)

0 0 举报