![](https://img-blog.csdnimg.cn/20201014180756918.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Vue
缘之妙不可言
java
展开
-
elementui在vue校验表单失效的原因之一(当表单含有一到多个对象)
错误表现:el-input框有数据但是却始终显示校验失败信息一般错误原因:form没有绑定modelprop与v-model名称不一样本次错误原因:存在当类似 form.user.name 格式的数据双向绑定而后,校验失败且正确后校验信息不会消失解决办法1.prop=“name"改成"user.name”,2.并且在校验规则里面将对应"name"改成[‘user.name’]或者绝对字符串的’user.name’,也要加中括号如图:有疑问请留言。...原创 2021-03-15 22:19:17 · 791 阅读 · 0 评论 -
Vue在插槽slot时报错:Component template should contain exactly one root element. If you are using v-ifen
Component template should contain exactly one root element. If you are using v-if on multiple elements, use v-else-if to chain them instead插槽使用报错。google translation:组件模板应仅包含一个根元素。 如果要在多个元素上使用v-if,请改为使用v-else-if链接它们。解决办法:普通的模板解决方法:在模板最外面加一个div来包含模板(组件原创 2020-09-11 11:03:30 · 868 阅读 · 0 评论