el
The first way of writing: object style
el
The second way of writing: Mounting method of prototype object
Variables starting with $ are programmer-oriented variables and methods.
Methods and properties on the instance prototype object, and Prototype is the prototype object.
model_Vue.$mount("#prj")
$mount is the mounting method, Vue
connecting the container and the instance.
data
The first way to write object form
data
The second way of writing is functional expression
Write data as a function and must return an object. The object data is the required
const model_Vue = new Vue({
el: '#model',
data:function(){
return {
modelChoiceTitleContent: "作品展示"
}
}
})
Vue
Call this function and call console.log(this)
Discovery this
to be Vue
an instance object
Note: It is required to be an ordinary function, not an anonymous function. The anonymous (arrow) function this
is window
, and Vue
the managed functions are required to be written as ordinary functions.
data:function(){...}
abbreviationdata(){...}