什么是MVC
MVC全名是Model View Controller,是模型(model)-视图(view)-控制器(controller)的缩写,是一种软件设计模式。
Moder负责数据的获取
View负责HTML的展示
Control:1.触发Moder获取数据2.触发View渲染
举例说明MVC(以loadSongs文件为例)
基础的MVC(三段论)


进阶(主要在Control里有变化)
- 把对象变成了构造函数的一个用例
-
增加了事件监听

MVC全名是Model View Controller,是模型(model)-视图(view)-控制器(controller)的缩写,是一种软件设计模式。
Moder负责数据的获取
View负责HTML的展示
Control:1.触发Moder获取数据2.触发View渲染
增加了事件监听
本文标题:MVC(套路)
本文链接:https://www.haomeiwen.com/subject/yynvextx.html
网友评论