[Vuejs]-Vue props passing from parent component to child

0👍

beforeCreate is called before data observation. Try again using beforeMount

0👍

Simply in the beforeCreate life cycle method your data object not loaded yet so you can’t call it at this time so the best practice for this to use created method

beforeCreate()

This is the very first lifecycle hook that gets called in Vue JS, it gets called immediately after the Vue instance has been initialized.

created()

the second lifecycle hook that is called right after the beforeCreated hook. At this stage, the Vue instance has been initialized and has activated the start of things like computed properties, watchers, events, data properties and manipulations that come with it.

enter image description here

created: function(){
    axios.post('')
    .then(response => {
        this.title = response.title
   })
}

Leave a comment