1. There are three components
-1-ordering component
-2-ordered component
-3-button component (button for adding meals)
2. Logic function
-1-Click the add button in the ordering component to display
3 in the click. There is a code
-1-order component:
:
-2- :
-3- :
4. Question:
each meal needs to be clicked twice to be displayed in the ordered component.
5. Personal analysis:
when there is no click to add event, the count of the meal is not available at first, so passing it to the button component is actually empty; when you click the add button, add 1 to the count of the meal, the calculation attribute judgment in the ordering component will be passed, and only in this way will it be displayed; every meal is like this
6. If the value is passed directly to the selected component, and if it has been selected as a sub-component of the selected meal, it is fine; but now the problem is that the two are not father-son relationship, but sibling relationship. Try to pass eventbus, but it still does not work. When eventbus is a page created, it will only be executed once
.7. Ask how to solve the problem.