[Vuejs]-Vue access valid data from parent component

0👍

You can try Props instead, it’s much easier. From docs:

child-component.vue

Vue.component('blog-post', {
  // camelCase in JavaScript
  props: ['postTitle'],
  template: '<h3>{{ postTitle }}</h3>'
})

parent.vue

<blog-post post-title="hello!"></blog-post>

Leave a comment