当前位置:网站首页>Conflict between v-mode and v-decorator in Ant Design
Conflict between v-mode and v-decorator in Ant Design
2022-06-25 05:09:00 【Lijianyi】
Project scenario :
Use ant-design Of form Components :
stay a-form When an input box component is used in a component ,v-model Cannot bind data in both directions
Problem description :
Enable v-decorator When performing input box data verification ,v-model Binding data cannot be bound
<a-form :form="form">
<a-form-item label="name">
<a-input v-model="name" v-decorator="['name', { rules: [{ required: true, message: 'Please input your note!' }] }]" />
</a-form-item>
</a-form>
data(){
return {
name: '123',
}
}
Cause analysis :
Tested repeatedly , Discover delete v-decorator after ,v-model Data can be bound normally .
Solution :
Join in v-decorator Can't use after v-model Two way data binding , Only through setFieldsValue() Methods to make data changes
<a-form :form="form">
<a-form-item label="name">
<a-input v-decorator="['name', { rules: [{ required: true, message: 'Please input your note!' }] }]" />
</a-form-item>
</a-form>
mounted(){
this.form.setFieldsValue({
name: '1234'
})
}
边栏推荐
猜你喜欢
buuctf(pwn)
hr竟主动给这位测试小姐姐涨工资,她是怎么做到的?
Reading and writing of nodejs excel (.Xlsx) files
MySQL prevents Chinese garbled code and solves the problem of Chinese garbled code
buuctf(re)
In Net 6 using dotnet format formatting code
Introduction to the hardest core PWN in the whole network_ Graphic analysis
How do the defi protocols perform under this round of stress test?
buuctf web
Méthode de récupération des données d'ouverture du disque dur à l'état solide
随机推荐
Use serialize in egg to read and write split tables
parallel recovery slave next change & parallel recovery push change
ORA-00800: soft external error
Eyeshot Ultimate 2022 Crack By Xacker
Filter & listener (XIV)
How to install the blue lake plug-in to support Photoshop CC 2017
渗透测试-目录遍历漏洞
Two hours to take you into the software testing industry (with a full set of software testing learning routes)
Laravel Aurora push
小白一键重装官网下载使用方法
IronOCR 2022.1 Crack
JS function to realize simple calculator
电脑的dwg文件怎么打开
Penetration information collection steps (simplified version)
ASEMI三相整流桥的工作原理
Rce code execution & command execution (V)
Database query optimization method
Integrate CDN to create the ultimate service experience for customers!
【Keil】ADuCM4050官方库的GPIO输出宏定义
[relax's law of life lying on the square] those poisonous chicken soup that seem to be too light and too heavy, but think carefully and fear