gitmyhub

learnVue

JavaScript ★ 13k updated 3y ago

:octocat:Vue.js 源码解析

A Chinese-language study guide with annotated Vue.js 2 source code and written articles explaining how Vue's reactivity, virtual DOM, and template compilation work internally.

JavaScriptVue.jsVuexsetup: easycomplexity 1/5

learnVue is a Chinese-language educational repository documenting one developer's study of the Vue.js framework's internal source code. Rather than a tool or library you would install and use, this is a collection of annotated source files and written articles meant to help other developers understand how Vue.js works under the hood.

The repository includes commented copies of the source code for Vue.js (version 2.3.0), Vuex (Vue's state management library, version 2.4.0), and Vue-router (version 3.0.1), stored in separate subfolders. The author has added Chinese-language comments throughout to explain what each section does.

The README lists a set of articles covering specific Vue.js internals, including how Vue's reactivity system detects changes to data, how it tracks dependencies between data and the components that use it, how it uses a virtual representation of the page (called a Virtual DOM) and a comparison algorithm (called diff) to update only the parts of the page that changed, how it compiles HTML templates into JavaScript, and how it schedules DOM updates asynchronously. There are also articles on Vuex internals, the keep-alive component, and component communication patterns.

The content is written in Chinese and aimed at developers who already have some experience with Vue.js and want to go deeper into how it is built. The author also published a book on Vue.js internals and links to it from the README. The repository does not contain a runnable application or installable package.

Where it fits