0
votes

I have parent and child components and I am trying to pass props between them. the parent is called links and the child is link-encoded. I have the child like this in the html template

<links-encoded title="hellooo"></links-encoded>

and in vue file for the parent i have

data() {
    return {

        title:"helloooo"
}

on the child vue i have

export default class LinksEncodedComponent extends Vue {
    props: ['title']
}

and in the child html

      <p>{{title}}</p>
2

2 Answers

0
votes

This is the proper way to bind title data property of the parent to the title prop of a child:

<links-encoded :title="title"></links-encoded>

-1
votes

fixed i had to put props: ['title'] inside @Component()