Vue2数据到视图渲染过程中,如何实现模板的详细渲染机制?
- 内容介绍
- 文章标签
- 相关推荐
本文共计3926个文字,预计阅读时间需要16分钟。
目录+引言+1、从new Vue()入口开始:+2、this._init+3、挂载函数vm.$mount(vm.$options.el)+4、mountComponent函数+5、_render函数+6、createElement函数返回虚拟DOM+7、_update函数+8、patch函数+9、createElm函数+1
目录
- 引言
- 1、从new Vue()入口开始:
- 2、this._init
- 3、挂载函数vm.$mount(vm.$options.el)
- 4、mountComponent函数
- 5、_render函数
- 6、createElement函数返回虚拟DOM
- 7、_update函数
- 8、patch函数
- 9、createElm函数
- 10、移除
引言
一般使用html,css和javascript直接将数据渲染到视图中,需要关心如何去操作dom,如果数据量比较大,那么操作过程将会繁琐且不好控制。vue将这些操作内置,开发过程中只需要关注数据的变化,视图的变化由vue框架内部实现。
本文共计3926个文字,预计阅读时间需要16分钟。
目录+引言+1、从new Vue()入口开始:+2、this._init+3、挂载函数vm.$mount(vm.$options.el)+4、mountComponent函数+5、_render函数+6、createElement函数返回虚拟DOM+7、_update函数+8、patch函数+9、createElm函数+1
目录
- 引言
- 1、从new Vue()入口开始:
- 2、this._init
- 3、挂载函数vm.$mount(vm.$options.el)
- 4、mountComponent函数
- 5、_render函数
- 6、createElement函数返回虚拟DOM
- 7、_update函数
- 8、patch函数
- 9、createElm函数
- 10、移除
引言
一般使用html,css和javascript直接将数据渲染到视图中,需要关心如何去操作dom,如果数据量比较大,那么操作过程将会繁琐且不好控制。vue将这些操作内置,开发过程中只需要关注数据的变化,视图的变化由vue框架内部实现。

