更新时间:2023-12-05 17:37:28
对于vue> = 2.0
使用mounted
,对于以前的版本使用ready
.
For vue >= 2.0
use mounted
and for previous version use ready
.
vm=new Vue({
el:"#app",
mounted:function(){
this.method1() //method1 will execute at pageload
},
methods:{
method1:function(){
/* your logic */
}
},
})