1. Responsivity principle of Vue2.0

The responsivity principle of VUe2.0 is implemented based on Object.defindePropertyCopy the code

2, Vue3.0 responsive principle

Data hijacking in VUe3.0 uses Proxy objects in ES6, which is not supported by Proxy IE. The performance is better than Object. DefindeProperty, which is optimized by browser. Proxy listens directly on objects, not properties, and there is no loop required to convert multiple properties to GET and set.Copy the code

Publish/subscribe/Observer

1. Observer mode is scheduled by a specific target. For example, when an event is triggered, THE Dep will call the observer method, so there is a dependency between the subscriber and publisher of observer mode. Publish/subscribe is invoked by a unified dispatch center, so publishers and subscribers do not need to know of each other's existenceCopy the code

4. Vue responsive schematic diagram

Vue injects data members into Vue instances and converts data members into getters/setters. Compiler parses the instructions/interpolation expressions in each element and replaces them with the corresponding data. 4. Dep adds watcher and notifits all observers when data changesCopy the code

5. Data-driven