A component (parent component) obtains a batch of data through the interface. The parent component props are passed to the child component (B)
After the child component renders this batch of data, there is a button that needs to be clicked to change the current state, such as from "Add to Shopping Cart" to "Add to Shopping Cart". I don’t know how to handle it so that it can dynamically change the state while clicking?
Is the event customized through sub-component?
Don’t know how to write?
What is the status controlled by?
If your sub-component controls data state changes
Of course it is done through the sub-component custom event
It mainly depends on how you layout it
It is recommended to use vuex to manage status https://vuex.vuejs.org/