1.

Why should arrow functions not be used in writing lifecycle hooks in Vue instances?

Answer»
  1. One-way data flow implies that the model is the only source of TRUTH. In CONTRAST, two-way data-BINDING means that UI fields are found to model data. Therefore, in case of the UI field changes, the model data also changes and vice-versa. 
  2. One-way data flows are deterministic; in contrast, the two-way binding is associated with SEVERAL side effects that are difficult to identify and understand. 
  3. In the one-way data flow, the UI part of the application does not update automatically when a data model is changed. We ought to write some custom code to update every time a data model changes. V-bind is UTILIZED for one-way data flow or binding. For two-way data binding, the UI part of the application automatically revises when the data Model is changed. The V-model directive is utilized for two-way data binding. 


Discussion

No Comment Found

Related InterviewSolutions