当前位置:网站首页>Bidirectional data binding V-model and v-decorator
Bidirectional data binding V-model and v-decorator
2022-06-22 16:36:00 【xiao_ zhu_ ting_ feng】
Data binding
1. One way data binding
Write the data in html In structure , Then render , once HTML After code generation , There's no way to change , If new data appears , Then you have to put the previous HTML Delete the code , And then integrate the new data and template together to form a new HTML Code , Then insert it into the document stream
2. Two way data binding
Two way binding between data model and view . When the data changes , The view changes , When the view changes , The data will also change synchronously ; It can be said that the user's changes on the view will be automatically synchronized to the data model , The data model changes the same . Advantages of two-way data binding : You don't need to do it like one-way data binding CRUD(Create,Retrieve,Update,Delete) operation , Two way data binding is most often used on forms , In this way, when the user completes the input on the front page , Without any operation , We have got the data entered by the user , And put it into the data model .
2.1 v-decorator
Vue in , Use v-model To do data binding , stay Vue-Ant Design The use of the framework , There will be v-decorator Use , But when both are used at the same time ,v-model Data binding fails ,
2.2 v-model
v-model Two way binding for form data , In fact, it is a grammatical sugar , There are two operations behind this :
1. v-bind Bind one value attribute
2. v-on Instruction to bind the current element input event
Custom components use v-model, There should be the following operations :
1. Receive one value prop
2. Trigger input event , And pass in a new value
边栏推荐
猜你喜欢

SAP ABAP dialog programming tutorial: module pool in -09

jsp學習之(二)---------jsp脚本元素和指令

短视频源码开发,优质的短视频源码需要做好哪几点?

ABAP query tutorial in sap: sq01, sq02, sq03-017

SAP web service 无法使用 SOAMANAGER 登陆到SOA管理页面

What is restful and what rules should be followed when designing rest APIs?

C语言贪吃蛇

Static assertion static_ assert

如何为政企移动办公加上一道“安全锁”?

使用stream api替代sql
随机推荐
C语言贪吃蛇
视频爆炸时代,谁在支撑视频生态网高速运行?
面试题之JS判断数据类型的方法
Static assertion static_ assert
SAP web service cannot log in to SOA management page with soamanager
超出文本部分用省略号表示
SAP价值流程&帮助请求流程-011
Parts beyond the text are indicated by ellipsis
nio服务多线程版本
Safari兼容性问题总结
【微信小程序获取自定义tabbar的高度】绝对可用!!!
[C language] deeply analyze the storage of integer and floating-point types in memory
SAP ABAP 子屏幕教程:在 SAP 中调用子屏幕-010
Cmake tutorial series-00-introduction
SAP ABAP internal tables: create, read, populate, copy and delete-06
Modularity in SAP ABAP: macros, subroutines and function modules -04
oracle分库分表
Test for API
变量
【C语言】深度剖析指针和数组的关系