Pass data from parent to child component in vue.js

后端 未结 2 1945
一生所求
一生所求 2020-12-03 13:59

I am trying to pass data from a parent to a child component. However, the data I am trying to pass keeps printing out as blank in the child component. My code:

In

2条回答
  •  温柔的废话
    2020-12-03 14:26

    Please note the following:

    • you missed out the line detailing 'Vue.component'
    • you need to define the props passed in the child component
    • you need to call getCurrentUser() when the parent component initialises

    Parent Component...

    
    
    
    

    Child Component...

    
    
    

提交回复
热议问题