Comments (16)
@li-changyu 可以看一下Vue作者在知乎的回答 https://www.zhihu.com/question/49929356/answer/118534768
from blog.
@pomelovico 您好~ 不是的,模板编译只是会把模板编译成渲染函数,只有在渲染函数被执行的时候才会对数据进行访问,而渲染函数是在watche实例中执行的,所以渲染函数中所使用到的所有数据,都会被同一个Watcher监听,当这些状态发生变化时,会通知这个Watcher,这个Watcher会触发VirtualDOM对组件进行渲染。
一个组件的模板会被编译成一个渲染函数。每个组件有一个Watcher用来监听模板中所使用到的数据、当这些数据发生变化时,通过VirtualDOM进行更新组件的视图
from blog.
很详细,赞
from blog.
非常棒, 感谢分享!
from blog.
非常不错
from blog.
博主你好,请问在模板编译的阶段,是不是就会对每个组件所使用的data或者computed值进行访问,从而创建新的Watcher进行订阅,然后对应的属性的dep就会收集这些watcher,从而实现更新的?
from blog.
请问一下,为什么单个文本节点如果标记了 消耗会更大
from blog.
@AlvinYuXT 我也不是很清楚为什么,嘿嘿嘿、如果有人知道希望在评论中通知我一下,跪谢~
from blog.
@berwin 看了一下,可能是因为在renderStatic的时候 需要clone一遍VNode。
from blog.
请教一下为什么生成render function的时候用到了 with(this) {
... } 这种写法,使用with语句不会对性能有影响吗?
from blog.
👍 💯 好文章,理解起来还是挺有帮助的,收藏!
from blog.
这个with在线构建的方案使用的真的是很精妙
from blog.
好文,很有帮助.
因为在 HTML 中有一种 自闭和标签,比如 input。
改为自闭合标签好些? 😆
from blog.
@LonHon 哈哈哈,错别字,已改。可以关注下我的新书,书里讲的比文章要详细很多。
from blog.
精辟!就是模板解析器那里专门去看了博主的另一篇文章才懂
from blog.
for 嵌套作用域是怎么处理的?这模板原理没看出来。
from blog.
Related Issues (20)
- 时间切片(Time Slicing) HOT 16
- 让你的网页更丝滑(全) HOT 11
- 需求分析与开发时间评估 HOT 5
- 捕获FMP的原理 HOT 4
- 小程序底层实现原理及一些思考 HOT 7
- 关于代码评审(Code Review)
- 我的英语老师 HOT 4
- Web性能领域常见的专业术语 HOT 10
- Largest Contentful Paint (LCP) HOT 2
- 2019年终总结 HOT 4
- 小程序底层实现原理及一些思考(2) HOT 9
- 我在阿里半年收获的成长 HOT 8
- 【经济学+前端技术】双视角分析 - 哪些技术值得投入学习 HOT 4
- 2020年终总结 HOT 6
- 我在阿里一年收获的成长 HOT 1
- 前端工程师如何在业余时间提升自己? HOT 3
- 2021年终总结 HOT 7
- Tubes响应性数据系统的设计与原理 HOT 2
- 二维空间下的向量旋转 HOT 2
- 2022年终总结 HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from blog.