当前位置:网站首页>El form item regular verification
El form item regular verification
2022-07-01 13:48:00 【A fake front-end man】
<el-form-item label=" Name of commodity " prop="name">
<el-input type="text" v-model.trim="param.name" style="width:640px" @change="handleChange" maxlength="30" ></el-input>
</el-form-item>
rules:{
name: [
{
validator: (rule, value, callback) => {
console.log(value, 'lail ')
if (!value) {
callback(new Error(' Please enter the product name '))
} else {
let chinese = []
let noChinese = []
chinese = value.split('').filter(item => {
return /^[\u4e00-\u9fa5]{0,}$/.test(item) === true
})
noChinese = value.split('').filter(item => {
return /^[\u4e00-\u9fa5]{0,}$/.test(item) !== true
})
var num = chinese.length * 2 + noChinese.length
console.log(num)
if (num < 4 || num > 30) {
callback(new Error(' Please enter 2 To 15 The Chinese characters .'))
}
}
},
trigger: 'blur',
required: true
}
],
}
边栏推荐
- 小程序-小程序图表库(F2图表库)
- Enter the top six! Boyun's sales ranking in China's cloud management software market continues to rise
- 受益互联网出海 汇量科技业绩重回高增长
- Kongsong (Xintong Institute) - cloud security capacity building and trend in the digital era
- Anti fraud, refusing to gamble, safe payment | there are many online investment scams, so it's impossible to make money like this
- word2vec训练中文词向量
- C语言课程设计题目
- App automation testing Kaiyuan platform appium runner
- 奔涌而来的数字化浪潮,将怎样颠覆未来?
- 【IoT毕设.下】STM32+机智云AIoT+实验室安全监控系统
猜你喜欢
![[NLP] pre training model - gpt1](/img/bd/9803ad946b33159de51b93106a2151.png)
[NLP] pre training model - gpt1

逻辑是个好东西

French Data Protection Agency: using Google Analytics or violating gdpr

A new book by teacher Zhang Yujin of Tsinghua University: 2D vision system and image technology (five copies will be sent at the end of the article)

Build a vc2010 development environment and create a tutorial of "realizing Tetris game in C language"

The best landing practice of cave state in an Internet ⽹⾦ financial technology enterprise

Chen Yu (Aqua) - Safety - & gt; Cloud Security - & gt; Multicloud security

Self cultivation of open source programmers who contributed tens of millions of lines of code to shardingsphere and later became CEO

日志中打印统计信息的方案

Fiori applications are shared through the enhancement of adaptation project
随机推荐
Collation and review of knowledge points of Microcomputer Principle and interface technology - pure manual
Listen in the network
网络中的listen
Leetcode question 1: sum of two numbers (3 languages)
使用CMD修复和恢复病毒感染文件
新手准备多少钱可以玩期货?农产品可以吗?
自定义注解实现验证信息的功能
B站被骂上了热搜。。
【 剑指 Offer】55 - I. 二叉树的深度
JVM有哪些类加载机制?
About fossage 2.0 "meta force meta universe system development logic scheme (details)
Understand the window query function of tdengine in one article
二传感器尺寸「建议收藏」
QT社团管理系统
Analysis report on the development trend and prospect scale of silicon intermediary industry in the world and China Ⓩ 2022 ~ 2027
Word2vec training Chinese word vector
arthas使用
Yan Rong looks at how to formulate a multi cloud strategy in the era of hybrid cloud
我们该如何保护自己的密码?
面试题目总结(1) https中间人攻击,ConcurrentHashMap的原理 ,serialVersionUID常量,redis单线程,