Written in the beginning

As one of the three frameworks, VUE naturally has its unique, today is to mainly talk about vUE in the interview will have what often encountered problems, traps and other matters to note.

1. My understanding of Vue’s progressive framework (Tencent Medical Code) :

A) Progressive meaning: making the least claim and not doing more than your duty

B) Vue is inferior to React and Angular in some respects. But it’s incremental, it’s not compelling, you can implement a component or two on top of the original system, as jQuery does;

C) It can also be used for whole family development, when Angular uses it; You can also use its view with an entire lower layer of your own design.

D) You can use the idea of OO and design patterns in the underlying data logic, or you can use functional, either way, it’s just a lightweight view that does what it should, not what it shouldn’t, and that’s it.

2. Principle of bidirectional binding of VUE (Tencent Medical Code) :

A) Two-way data binding is implemented through data hijacking combined with the publisher-subscriber pattern.

B) Specific implementation process:

I. Implement a listener Observer that hijacks and listens to all attributes and notifies subscribers if any changes are made

Ii. Implement a subscriber Watcher that receives notification of property changes and executes corresponding functions to update the view

Iii. Implement a parser Compile, which can scan and parse the relevant instructions of each node, and initialize the corresponding subscriber according to the initialization template data

C) The following flow chart is enough:

To be continued…….