Tutorialsplane

Vue.Js Call function on Page Load


Vue.Js Call function on Page Load – It is very simple to call function on page load in Vue.Js.


Vue.Js Call function on Page Load Example

You can call function on page load in vue.js simply as below –

Vue.Js Call function on Page Load Example:

new Vue({
    // ...
    methods:{
        myFunction: function() {//definition goes here}
    },
    created: function(){
        this.myFunction()
    }
});

We can use created to call function on page load in vue.js, The myFunction() will be called on page load.