当前位置:网站首页>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
}
],
}
边栏推荐
- 建立自己的网站(21)
- Arthas use
- 3.4 《数据库系统概论》之数据查询—SELECT(单表查询、连接查询、嵌套查询、集合查询、多表查询)
- [Jianzhi offer] 55 - ii balanced binary tree
- Learning to use livedata and ViewModel will make it easier for you to write business
- 【NLP】预训练模型——GPT1
- “国防七子”经费暴增,清华足足362亿元,甩第二名101亿 |全国高校2022预算大公开...
- About fossage 2.0 "meta force meta universe system development logic scheme (details)
- MySQL 66 questions, 20000 words + 50 pictures in detail! Necessary for review
- 研发效能度量框架解读
猜你喜欢

SAP intelligent robot process automation (IRPA) solution sharing

研发效能度量框架解读

Kongsong (Xintong Institute) - cloud security capacity building and trend in the digital era

spark源码(五)DAGScheduler TaskScheduler如何配合提交任务,application、job、stage、taskset、task对应关系是什么?

Station B was scolded on the hot search..

一文读懂TDengine的窗口查询功能

8 popular recommended style layout

Dragon lizard community open source coolbpf, BPF program development efficiency increased 100 times

算网融合赋能行业转型,移动云点亮数智未来新路标

2022 · 让我带你Jetpack架构组件从入门到精通 — Lifecycle
随机推荐
Global and Chinese silicone defoamer production and marketing demand and investment forecast analysis report Ⓨ 2022 ~ 2027
MySQL六十六问,两万字+五十图详解!复习必备
1. Sum of two numbers: given an integer array num and an integer target value, please find the two integers whose sum is the target value target in the array and return their array subscripts
leetcode 322. Coin Change 零钱兑换(中等)
【IoT毕设.下】STM32+机智云AIoT+实验室安全监控系统
盲盒NFT数字藏品平台系统开发(搭建源码)
焱融看 | 混合云时代下,如何制定多云策略
新手准备多少钱可以玩期货?农产品可以吗?
Analysis report on the development prospect and investment strategy of the global and Chinese laser chip industry Ⓑ 2022 ~ 2027
The best landing practice of cave state in an Internet ⽹⾦ financial technology enterprise
App automation testing Kaiyuan platform appium runner
Computer network interview knowledge points
Grafana reports an error: error= "failed to send notification to email addresses: [email protected] : 535 Error:
Fiori 应用通过 Adaptation Project 的增强方式分享
面试题目总结(1) https中间人攻击,ConcurrentHashMap的原理 ,serialVersionUID常量,redis单线程,
ArrayList capacity expansion mechanism and thread safety
用栈实现队列、用队列实现栈(C语言_leetcode_232+225)
基于算力驱动、数据与功能协同的分布式动态(协同)渲染/功能运行时
AnimeSR:可学习的降质算子与新的真实世界动漫VSR数据集
9. Use of better scroll and ref