在vue中,我们通过newVue()得到一个vue实例//类似的例子函数Man(options){//对属性的一系列操作}//lisi是构造函数的实例化ManTheobjectletlisi=newMan({name:'lisi',age:'20',gender:'male'})//用Vue的构造函数实例化一个对象vmVue//引入options对象作为参数letvm=newVue({//optionsobjectel:"#myapp",data:{},methods:{},beforeCreate(){console.log('beforeCreate')},})console.log(vm.$options)//打印出对象属性包括el数据方法beforecreate$options打印结果如下在源码中的vue构造函数中,options作为参数传入,el、data、methods等一系列生命周期函数传入在我们实例化的时候都是all是options对象的属性
