vuejs props - parent variables

Viewed 116

I have this props in a vue page (apps.vue)

props: {
  vote: {
    type: Object,
    default: () => {
      return {};
    }
  },
},

as far as I know the property "props" is used to pass data from parent to children. I think apps.vue is the child (right ?)

I want how can I find the parent file of that property because I need to check its variables

exp: this.vote.good

1 Answers

apps.vue

<Apps :vote="data" />

children component

in templete

{{ data }}

in script

this.data

and ...

export default {
  props: ['vote']
}

or

export default {
  props: {
     vote: {
         require: true,
         type: String,
         default: ''
     }
  }
}
Related