Vue.js - Using parent data in component
How I can get access to parent's data variable (limitByNumber) in my child component Post? I tried to use prop but it doesn't work. Parent: import Post from './components/Post.vue'; new Vue ({ el: 'body', components: { Post }, data: { limitByNumber: 4 } }); Component Post: <template> <div class="Post" v-for="post in list | limitBy limitByNumber"> <!-- Blog Post --> .... </div> </template> <!-- script --> <script> export default { props: ['list', 'limitByNumber'], created() { this.list = JSON.parse(this.list); } } </script> Option 1 Use this.$parent.limitByNumber from child component. So your