设计模式
2018-08-05 本文已影响0人
sendyLuo
1.MVP
modal:数据层
view:视图层 一般知道是页面中的dom展示
presenter:呈现层 也就是业务逻辑相关的控制层


2.MVC

3.MVVM


PS:只需要关注视图层和模型层(数据层),VM层是框架内置实现的(M层的开发才是重点,也就是在面向数据进行编程)
VM层的实现:vue是怎样知道数据改变了,又怎样去改变视图的?
PS:1.用到ES5里面比较核心的APIObject.defineProperties()
2.引入了虚拟DOM
MVC和MVVM之间的区别:
mvc数据流通是单向的,mvvm是双向数据绑定
