Home  >  Q&A  >  body text

javascript - I have been learning vue.js recently, and there is still a certain gap in my understanding of its parent and child components!

I saw the api on the official website and this picture, but I don’t understand it very well. I feel that the components are similar to the custom instructions of angularjs..

伊谢尔伦伊谢尔伦2704 days ago639

reply all(3)I'll reply

  • 过去多啦不再A梦

    过去多啦不再A梦2017-05-24 11:38:46

    The general meaning is that the child component and the parent component communicate with each other. The child component may call the parent component's method, but please do not let the child component depend on the parent component and cannot be used in other places

    reply
    0
  • 给我你的怀抱

    给我你的怀抱2017-05-24 11:38:46

    The parent component passes data to the child component through props, changes the state of the child component, etc.
    The child component passes the event to the parent component through events for further processing
    Reduces the coupling between components.

    reply
    0
  • 迷茫

    迷茫2017-05-24 11:38:46

    The biggest feeling that Vue’s components give me is that as long as you write it well, I will introduce the components that need to pass parameters into the page. Even if I don’t pass anything, the component will not report an error

    reply
    0
  • Cancelreply