当前位置:网站首页>Formulaire uview, carte d'identité, clavier, authentification en temps réel
Formulaire uview, carte d'identité, clavier, authentification en temps réel
2022-07-21 01:01:00 【Qu Shuai 369】
<u-form-item label="Numéro d'identification" prop="card" ref="card">
<u-input v-model="form.card" placeholder="Veuillez entrer le numéro d'identification" @click="keyCardShow = true" />
<u-keyboard ref="uKeyboardCard" mode="card" v-model="keyCardShow" @change="valChangeCard" @backspace="backspaceCard" :mask="false">
</u-keyboard>
</u-form-item>
rules: {
card: [{
required: true,
message: 'Veuillez entrer votre carte d'identité',
trigger: ['blur','change'],
},
{
// Fonction de validation personnalisée
validator: (rule, value, callback) => {
// RetourtrueIndique que la vérification est réussie,RetourfalseIndique un échec
return this.$u.test.idCard(value)
},
message: 'Carte d'identité incorrecte',
// Les déclencheurs peuvent être utilisés simultanémentblurEtchange
trigger: ['blur','change'],
}
],
}
valChangeCard(val) {
// Connectez les valeurs de chaque clé à valueDans la variable,Attention!+=Écrire
this.form.card += val;
this.triggerSingleFieldValidate("card")
},
// La touche Backspace est cliquée
backspaceCard() {
// SupprimervalueDernier caractère de
if (this.form.card.length) this.form.card = this.form.card.substr(0, this.form.card.length - 1);
this.triggerSingleFieldValidate("card")
},
//Validation
triggerSingleFieldValidate(refName) {
setTimeout(()=>{
this.$refs[refName].onFieldChange()
},200)
}
边栏推荐
- Operation of variables in MySQL
- Qt:Could not find qmake spec ‘default’.Error while parsing file xxx.pro. Giving up
- DeiT:注意力也能蒸馏
- Some rules for implicit conversion of SAP ABAP character and string variables
- Voulez - vous assurer la sécurité des logiciels à faible coût? Cinq missions de sécurité méritent d'être examinées
- Main research directions of Intelligent Question Answering
- Makefile details
- 解锁高评分 | eBay 深耕用户体验,优化大屏幕设备应用
- Import image method
- ArrayList basic case
猜你喜欢
Persuasion failed, and the police wrote code to expose the fraud on the spot, which made me have a brain hole
Px4 uses P900 data transmission
NET问答: C# 中是否有最高效的方式对大文件做 checksum ?
零信任和SASE有什么不一样?答案其实并不重要
【Pygame小游戏】魂斗罗经典BOSS都回来了 准备好再次击败他们了吗?(附源码)
这款国产良心软件正式开源!
Popular understanding of tensor
Implement metersphere signature signature through shell
[translation] dynamic query in C # expression
张量的通俗理解
随机推荐
网络流,二分图与图的匹配
WPF implements drawer menu
【731. 我的日程安排表 II】
Internet of things communication protocols: mqtt, COAP, nb-iot, RFID, Bluetooth, NFC
Detailed explanation of JDBC function classes
Import image method
Codeworks 5 questions per day (average 1500) - day 20
There are two key skills for high availability of microservices, which you must use
Win11暂存文件夹是什么?Win11在线升级暂存文件夹在哪
ArrayList basic case
Three principles CIOs should follow in order to successfully carry out digital transformation
Openvino model learning - from model to pipeline production
解锁高评分 | eBay 深耕用户体验,优化大屏幕设备应用
[easyui] modify the value in the DataGrid table
[leetcode] split the basic template and find the left and right boundaries
创建文件,如果文件的上级(或上上级等)目录不存在,则先创建上级目录,再创建文件
【LeetCode】二分基础模板,查找左右边界
CCTV news "Ningbo rent quota invoice by hand" news channel_ People's network
Learun, open source, one Net web quick open
LeetCode_90_子集Ⅱ