Vue framework--two ways of writing el and data in Vue

Two ways of writing data and el
1. There are two ways of writing el
   (1). Configure the el attribute when new Vue.
   (2). Create a Vue instance first, and then specify the value of el through vm.$mount('#root') .
2. There are two ways of writing data
  (1). Object style
   (2). How to choose the function style

   : any way of writing is acceptable at present. When learning components in the future, data must use the function style, otherwise an error will be reported.

 3. An important principle:
     For functions managed by Vue, you must not write arrow functions. Once you write arrow functions, this is no longer a Vue instance .

Applications:

Guess you like

Origin blog.csdn.net/u013185175/article/details/132619729