veeValidate
http://vee-validate.logaretm.com/index.html#about
自定义为空时候的提示
Field-specific Custom Messages
You might need to provide different messages for different fields, for example you might want to display an error message for the email field when its required, but a different messsage when the name is required. This allows you to give your users a flexible experience and context aware messages.
To do this you would need to add an object to the dictionary called custom like this:
const dict = {
en: {
custom: {
email: {
required: 'Your email is empty' // messages can be strings as well.
},
name: {
required: () => 'Your name is empty'
}
}
}
};
Notice that the
customobject contains properties that represent the field names, those field names objects contain properties that represent the validation rule that its value will be used instead of the default one.
Then you would need to add the dictionary we just constructed to the current validators dictionary like this:
Validator.updateDictionary(dict);
// or use the instance method
this.$validator.updateDictionary(dict);
veeValidate的更多相关文章
- Vue2.0表单校验组件vee-validate的使用
vee-validate使用教程 *本文适合有一定Vue2.0基础的同学参考,根据项目的实际情况来使用,关于Vue的使用不做多余解释.本人也是一边学习一边使用,如果错误之处敬请批评指出* 一.安装 n ...
- 使用vee-validate表单插件是如何设置中文提示?
最近在写vue表单验证的时候,在网上找到一款不错的插件vee-validate,在使用的过程中发现配置不了中文提示,这就很苦恼了,基本上网上的配置办法我都看过,都是有问题的,比如这种 import z ...
- Vue + iView + vuex + vee-validate 完整项目总结
build/*.js config/*.js src/旧代码文件夹 部门最近的一个新项目启动,很幸运由我来主导整个前端部分的技术选型和整体架构,项目工作量很大,但是却没有足够的人手,只有三个连CSS都 ...
- vee-validate的使用
官网地址:http://vee-validate.logaretm.com/ 这是一个插件Vue.js可以验证输入字段,显示错误,在一个简单而强大的方法.学习vee-validate,首先可以去阅读官 ...
- Vue.js + Nuxt.js 项目中使用 Vee-validate 表单校验
vee-validate 是为 Vue.js 量身打造的表单校验框架,允许您校验输入的内容并显示对应的错误提示信息.它内置了很多常见的校验规则,可以组合使用多种校验规则,大部分场景只需要配置就能实现开 ...
- vee-validate表单验证组件
vee-validate是VUE的基于模板的验证框架,允许您验证输入并显示错误 安装 npm i vee-validate --save 引入 import Vue from 'vue'; impor ...
- vee-validate校验demo
//太长了,把异步校验放到前面吧: VeeValidate.Validator.extend('checkLoginName',{ getMessage:function () { return &q ...
- 直接引用vee-validate校验插件
直接在页面引用vee-validate 源文件下载地址:http://www.bootcdn.cn/vee-validate/ 官方api https://baianat.github.io/vee- ...
- Vue 表单校验 vee-validate
gitHub 地址:https://github.com/baianat/vee-validate 官网API 地址:https://baianat.github.io/vee-validate/ap ...
- VeeValidate配置中文的两种方法
使用VeeValidate时遇到的问题,下面是我找到的一些解决办法: VeeValidate一直报错早不到addlocale方法 解决办法:1.卸载掉当前版本,重新安装低版本如2.0.0-rc.25 ...
随机推荐
- AMD,CMD,CommonJs,UMD讲解
一.CommonJS CommonJS规范加载模块是同步的,只有加载完成,才能执行后面的操作 CommonJS规范中的module.exports和require 每个文件就是一个模块,有自己的作用域 ...
- VS2013 执行Enable-Migrations,产生错误的解决办法
我的错误是:提示文件或资源没有找到”Microsoft.VisualStudio.Shell, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b0 ...
- 北京Uber优步司机奖励政策(3月15日)
滴快车单单2.5倍,注册地址:http://www.udache.com/ 如何注册Uber司机(全国版最新最详细注册流程)/月入2万/不用抢单:http://www.cnblogs.com/mfry ...
- hive整合sentry,impala,hue之后权限管理操作
7.Hive授权参考(开启sentry之后,对用户授权用不了,只能针对用户组,grant role testrole to user xxxxxxx; ) 7.1:角色创建和删除 create rol ...
- Android 项目,没有可运行的Module项
打开工程以后发现,可运行的Module 没有了.怎么办? 点击这个,即可.
- PostgreSQL 使用总结
1. USING的使用 USING是个缩写的概念:它接收一个用逗号分隔的字段名字列表, 这些字段必须是连接表共有的,最终形成一个连接条件,表示这些字段对必须相同. USING (a, b, c) 等效 ...
- 使用PowerDesign15反向生成数据库
在Pd15中建立物理模型后,可以通过反向工程直接生成数据库的表结构.主要有以下几个步骤: 1. 首先设置一下数据库配置,选择对应要使用的数据库(此处选择Sql Server 2008 R ...
- Ajax中post请求和get请求的区别
首先提出两点Post比Get大的不同地方 1.post请求浏览器每次不会缓存,每次都会重新请求,而get请求不要缓存的时候,需要手动设置 写上xhr.setRequestHeader("If ...
- jmeter关联三种常用方法
在LR中有自动关联跟手动关联,但在我看来手动关联更准确,在jmeter中,就只有手动关联 为什么要进行关联:对系统进行操作时,本次操作或下一次操作对服务器提交的请求,这参数里边有部分参数需要服务器返回 ...
- 【SpringCloud 】第八篇: 消息总线(Spring Cloud Bus)
前言: 必需学会SpringBoot基础知识 简介: spring cloud 为开发人员提供了快速构建分布式系统的一些工具,包括配置管理.服务发现.断路器.路由.微代理.事件总线.全局锁.决策竞选. ...