what
解决在服务端验证数据之后,客户端动态异步提示消息
how
html:ref引用
<el-form-item ref="accountType">
js实例属性与方法
//显示错误提示
this.$refs.accountType.validateMessage = 'error message';
this.$refs.accountType.validateState = 'error';
//清空方法
this.$refs.accountType.clearValidate()
效果
![](https://img.haomeiwen.com/i2333173/117898b89bdd5ab8.png)
![](https://img.haomeiwen.com/i2333173/961e823d2bdc56b5.png)
又及对应的源码
![](https://img.haomeiwen.com/i2333173/9a13b08f12f86c1d.png)
![](https://img.haomeiwen.com/i2333173/482c4a9392cfe20e.png)
网友评论