[Vuejs]-How to access props data?

0👍

Use this as you do normally with the data:

axios.get('/messages/' + this.surgery_id).then(...)

You can access all the property of data option,props, and methods using this as context.

Further, if you want to use ES6, then it’s even easier without concatenating them: (using tilde key `)

axios.get(`/messages/${this.surgery_id}`).then(...)

As per your query, you also need to pass props in your instance:

const app = new Vue({
  // ...
  propsData:{
    surgery_id: 'your id value'
  }

See my another post for more help.

Leave a comment