how to use the onload event n vue js

JavaScript
vm=new Vue({
  el:"#app",
  mounted:function(){
        this.method1() //method1 will execute at pageload
  },
  methods:{
        method1:function(){
              /* your logic */
        }
     },
})
Source

Also in JavaScript: