当前位置:网站首页>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 .
边栏推荐
- STM32通过串口进入和唤醒停止模式
- Docker starts MySQL and -emysql_ ROOT_ Password = my secret PW problem solving
- 氢创未来 产业加速 | 2022氢能专精特新创业大赛报名通道开启!
- The same job has two sources, and the same link has different database accounts. Why is the database list found in the second link the first account
- Talking about the current malpractice and future development
- What does security capability mean? What are the protection capabilities of different levels of ISO?
- Daily question brushing record (XV)
- 同一个作业有两个source,同一链接不同数据库账号,为何第二个链接查出来的数据库列表是第一个账号的
- Experiment 4: installing packages from Gui
- Gpt-3 is a peer review online when it has been submitted for its own research
猜你喜欢

JS addition, deletion, modification and query of JSON array

求帮助xampp做sqlilab是一片黑

leetcode:236. 二叉树的最近公共祖先

JDBC programming of MySQL database

Yaduo Sangu IPO

Cover fake big empty talk in robot material sorting

若依请求url中带有jsessionid的解决办法

How to implement Lua entry of API gateway

Why is bat still addicted to 996 when the four-day working system is being tried out in Britain?

(1) Chang'an chain learning notes - start Chang'an chain
随机推荐
问下各位,有没有flink sql生成作业的文档啊或是案列啊知道flink cli可以建表和指定目
Can async i/o be implemented by UDF operator and then called by SQL API? At present, it seems that only datastre can be seen
求帮助xampp做sqlilab是一片黑
Leetcode problem solving - 889 Construct binary tree according to preorder and postorder traversal
Implementation steps of mysql start log in docker
今日睡眠质量记录78分
请问async i/o可以由udf算子实现然后用sql api调用吗?目前好像只看到Datastre
短链的设计
Common modification commands of Oracle for tables
Restoration analysis of protobuf protocol of bullet screen in station B
本地部署 zeppelin 0.10.1
吴恩达2022机器学习课程评测来了!
flinksql select id ,count(*) from a group by id .
零代码高回报,如何用40套模板,能满足工作中95%的报表需求
MySQL数据库之JDBC编程
How to find out if the U disk file of the computer reinstallation system is hidden
A few suggestions for making rust library more beautiful! Have you learned?
《数字经济全景白皮书》保险数字化篇 重磅发布
How does crmeb mall system help marketing?
[communication] optimal power allocation in the uplink of two-layer wireless femtocell network with matlab code