user10991526
user10991526

Reputation: 135

Getting data between components in Vue JS

I really can't get binding data between components.

Steps,

  1. get text value from Child1 component
  2. execute Add method on App.vue
  3. send test value from App.vue and make a v-for list on Child2

No.3 is not working. I dont' even know 1,2 are correct on code.. How can I get input data to show item list?

Here's my code: Link

Upvotes: 0

Views: 117

Answers (1)

Treast
Treast

Reputation: 1105

Code fixed: https://codesandbox.io/s/parent-to-childbyclicking-pp4yy

You emit a input event on Child1, but the App.vue was not listening. Also, the list was wrongly pass on Child2 props.

Feel free to comment if you don't understand any part ;)

Upvotes: 1

Related Questions