Vue. Js is what

Vue. Js is a set of progressive frameworks for building user interfaces. Vue adopts a bottom-up incremental development design.

The goal of VUE is to implement the data binding and composite view components of the response through the simplest POSSIBLE API.

It provides advanced features commonly used in modern development:

  • Decouple views and data

  • Reusable components

  • The front-end routing

  • State management

  • Virtual DOM (Virtual DOM)

The MVVM pattern

MVVM (Model-view-ViewModel) mode is derived from MVC mode. When the View changes, it will automatically update to the ViewModel, and when the ViewModel changes, it will update the View. View and ViewModel are linked through bidirectional binding:

MVVM implementation practices

  • Set (‘property’, value) is used to update data.

  • Angular. js uses dirty value detection to determine whether to update a view by comparing data changes. The simplest method is to use setInterval() polling to detect data changes. Angular only checks for dirty values when a specified event is triggered

    • DOM events
    • XHR responds to events
    • Browser Location change event
    • Timer Event (timeout, interval)
    • Do digest() or apply()
  • Data hijacking: Vue.js adopts data hijacking combined with publiser-subscriber mode. It hijacks the setter and getter of each attribute through Object.defineProperty() to publish messages to subscribers when data changes and trigger corresponding listening callback. Quoting from this article