shit element ui & form password validation
shit element ui & form password validation
shit docs
https://github.com/yiminghe/async-validator#validate
https://element.eleme.io/#/zh-CN/component/form#biao-dan-yan-zheng
passWord: [
{
required: true,
message: "请输入密码",
trigger: "blur",
},
{
min: 3,
max: 20,
message: "长度在 3 到 20 个字符",
trigger: "blur",
}
],
passWordSure: [
{
required: true,
message: "请输入确认密码",
trigger: "blur",
},
{
min: 3,
max: 20,
// pattern: `^${this.$data.form.passWord}$`,
// pattern: `${this.$data.form.passWordSure}`,
message: "两次输入的密码不一致",
// message: " ",
trigger: "blur",
validator: (rule, value, callback) => {
console.log(`value =`, value);
// console.log(`rule =`, rule);
// console.log(`callback =`, callback);
let pwd = this.$data.form.passWord;
console.log(`passWord =`, pwd);
if(pwd === value) {
// green border
callback();
} else {
// red border
callback(new Error("两次输入的密码不一致"));
// this.$refs.formRef.validateField("passWordSure");
}
},
},
],
shit element ui & form password validation的更多相关文章
- Element UI Form 每行显示多列,即多个 el-form-item
Element UI Form组件使用问题. 每个 el-form-item 都会独占一行. 对于输入项很多的管理app, 能否在每个form中, 每行显示 2 个或者多个 el-form-item ...
- element ui form表单清空规则
公司项目重构,经过商定使用element ui.在重构项目的时候发现一下element ui上很蛋疼的东西. 例如,这个form表单就是一个.趁着在高铁上没事,把想写的东西写一下. 先说一下eleme ...
- element UI form 验证
1 form 添加rules,具体属性添加prop, 注意 prop 属性与v-model 子属性一致 2 data 对象添加 rules 3 验证方法调用 验证规则见: https://github ...
- element ui FORM表单
form表单 Form-Item Slot [label] 旧版语法 <el-form-item label="活动名称" prop="name"> ...
- Element Ui使用技巧——Form表单的校验规则rules详细说明
Element UI中对Form表单验证的使用介绍: Form 组件提供了表单验证的功能,只需要通过 rules 属性传入约定的验证规则,并将 Form-Item的 prop 属性设置为需校验的字段名 ...
- 使用饿了么ui表单验证报错: [Element Warn][Form]model is required for validat
[Element Warn][Form]model is required for validat 如文末的完整例子: 该提示说的是 form表单需要一个绑定一个 对象(使用:model=" ...
- 关于vue.js element ui 表单验证 this.$refs[formName].validate()的问题
方法使用前需了解: 来自”和“小编的小提示: 首先打印一下this.$refs[formName],检查是否拿到了正确的需要验证的form. 其次在拿到了正确的form后,检查该form上添加 ...
- Element ui结合springboot的简单实战
Eelment UI简单实战 前端开发 1 创建项目,导入element ui(略) 2 大致设计出想要的效果,如下 3 创建包 根据设计的大致模样在项目的components中创建对应的包,方便以后 ...
- 分享一个自搭的框架,使用Spring boot+Vue+Element UI
废弃,新的:https://www.cnblogs.com/hackyo/p/10453243.html 特点:前后端分离,可遵循restful 框架:后端使用Spring boot,整合了aop.a ...
随机推荐
- leetcode笔记(六)740. Delete and Earn
题目描述 Given an array nums of integers, you can perform operations on the array. In each operation, yo ...
- 利用C++中采用面向对象的思想顺序表
最近在复习数据结构,我用面向对象的思想实现了顺序表,采用C++语言. 首先建立在Visual Studio 2017中建立一个工程,然后新建一个类SqList.然后会生成SqList.h和SqList ...
- SpringBoot配置redis和分布式session-redis
springboot项目 和传统项目 配置redis的区别,更加简单方便,在分布式系统中,解决sesssion共享问题,可以用spring session redis. 1.pom.xml <d ...
- 路由器基础配置之dhcp配置
我们将以上面的拓扑图为例,router9为dhcp的服务器,为pc4,5,6分配三个不同网段的地址,pool为要分配的三个地址池,我们要把pc4设置为12网段,pc5设置成34网段,pc6设置成56网 ...
- jQuery做一个小小的移动图片的位置
样式图点击按钮移动: jQuery代码如下: $(function () { //上 $("#btnUp").click(function () { var ...
- 【cisco探索之路】
CISCO探索之路 show&debug&clear 1:show show version:显示版本信息show running-config:显示当前的配置show interfa ...
- js onsubmit和return false的关系
一直以来,我都是以为onsubmit=“return false”就不会进行提交,但经过项目之后才知道return false只是避免了之后的跳转,但onsubmit已经是正在进行了,故onsubmi ...
- MySQL学习路线图
- stm32+lwip(五):以太网帧发送测试
我是卓波,很高兴你来看我的博客. 系列文章: stm32+lwip(一):使用STM32CubeMX生成项目 stm32+lwip(二):UDP测试 stm32+lwip(三):TCP测试 stm32 ...
- Python3爬虫(十一) 爬虫与反爬虫
Infi-chu: http://www.cnblogs.com/Infi-chu/ 一.重要概念 二.爬虫反爬虫进化论