创立一个vue实例:
const vm = new Vue(options)
vm:vue的一个实例
vm的构造函数是Vue,依照ES6的说法,vm所属的类是Vue
options是 new Vue 的参数,咱们个别称之为选项或者结构选项
options的五大属性:
数据属性:
data-外部数据:
反对对象和函数,优先应用函数
methods-办法:
事件处理函数或者是一般函数
computed:
watch:
props-内部数据(属性):
propsData:
DOM属性:
el-挂载点:
只在用new创立实例时失效
能够用$mount() 代替
template:
render:
renderError:
生命周期钩子:
生beforeCreate、
created、
beforeMount、
mounted、
beforeUpdate、
updated、a
ctivated、
deactivated、
beforeDestroy、
destroyed、
errorCaptured
资源属性:
directives、
filters、
components-组件:
组合属性:
parent,
mixins、
extends、
provide、
inject
发表回复