当前位置:网站首页>MVC and MVVM
MVC and MVVM
2022-07-06 23:43:00 【Panda-6】
mvvm
Concept :MVVM yes Model-View-ViewModel Abbreviation , Corresponding to : data , View , Model view .Model It's the data model in our application ,View It is our UI View layer , adopt ViewModle, We can Modle The data in is mapped to View On view , meanwhile , stay View Layer modified some data , It will also reflect and update our Modle. The simple understanding is Two way data binding , That is, when the data changes , The view changes , When the view changes , The data will also change synchronously .
With vue For example :view Corresponding template,vm Corresponding new Vue({…}),model Corresponding data
1 . view View layer
<p>Hello, {
{
name }}!</p> --View layer --VUE One way binding in
<input v-model="name"> --View layer --VUE Two way binding in
2 . model The data layer
data: {
name: '' --Model layer
}
3 .VM layer
VUE The frame is encapsulated
new Vue({
…})
The relationship among the three :
view You can bind through events ( or v-model Instructions ) How to influence model,model Can affect... In the form of data binding view,viewModel It's a model and view Connected connectors

MVC Pattern summary ( Typical frameworks are angular.js)
1 . namely Model、View、Controller namely Data model 、 View 、 controller .
View: View layer ;
Model: Business data layer ;
Controller: controller . receive View Instructions passed from the layer , selection Model Data corresponding to layer , Carry out the corresponding operation .
2. Take a similar example in reality ,MVC Like the operation mode of a shop ,View The floor is equivalent to the storefront of this shop ,Model The floor is equivalent to the warehouse of this shop ,Controller The floor is equivalent to the executive department of this shop .
characteristic :MVC There are two modes , Either way ,MVC All communications are one-way , It can also be seen from the figure ,View The layer will be from Model Take the data , therefore MVC Medium View Layer and the Model There is still coupling between layers .
边栏推荐
- Gradle知识概括
- Design a red envelope grabbing system
- Use mitmproxy to cache 360 degree panoramic web pages offline
- matplotlib画柱状图并添加数值到图中
- Master binary tree in one article
- Gpt-3 is a peer review online when it has been submitted for its own research
- The programmer refused the offer because of low salary, HR became angry and netizens exploded
- 【通信】两层无线 Femtocell 网络上行链路中的最优功率分配附matlab代码
- Implementation steps of mysql start log in docker
- The best sister won the big factory offer of 8 test posts at one go, which made me very proud
猜你喜欢

JS addition, deletion, modification and query of JSON array

【通信】两层无线 Femtocell 网络上行链路中的最优功率分配附matlab代码

How to find out if the U disk file of the computer reinstallation system is hidden
MySQL implementation of field segmentation from one line to multiple lines of example code

Efficient ETL Testing

零代码高回报,如何用40套模板,能满足工作中95%的报表需求

Pdf batch splitting, merging, bookmark extraction, bookmark writing gadget

人均瑞数系列,瑞数 4 代 JS 逆向分析

B站大佬用我的世界搞出卷積神經網絡,LeCun轉發!爆肝6個月,播放破百萬

Use mitmproxy to cache 360 degree panoramic web pages offline
随机推荐
【OFDM通信】基于深度学习的OFDM系统信号检测附matlab代码
Knowledge * review
Entropy information entropy cross entropy
[communication] optimal power allocation in the uplink of two-layer wireless femtocell network with matlab code
短链的设计
Design a red envelope grabbing system
After 3 years of testing bytecan software, I was ruthlessly dismissed in February, trying to wake up my brother who was paddling
Cover fake big empty talk in robot material sorting
Nftscan Developer Platform launches Pro API commercial services
MySQL connected vscode successfully, but this error is reported
How to implement Lua entry of API gateway
问下各位,有没有flink sql生成作业的文档啊或是案列啊知道flink cli可以建表和指定目
士大夫哈哈哈
A novice asks a question. I am now deployed on a single machine. I submitted an SQL job and it runs normally. If I restart the service job, it will disappear and I will have to
How can Oracle CDC deserialize with jsondebeziumdeserializationschema
设计一个抢红包系统
Restoration analysis of protobuf protocol of bullet screen in station B
Wasserstein Slim GAIN with Gradient Penalty(WSGAIN-GP)介绍及代码实现——基于生成对抗网络的缺失数据填补
MATLIB从excel表中读取数据并画出函数图像
MySQL implementation of field segmentation from one line to multiple lines of example code