In the development process, it is common to encounter the requirement that a parent component passes a prop to a child component to control the state of the child component, and the child component itself also listens for events that change its state when triggered. However, because the storage of its state is placed on the prop transmitted by the parent component, if the prop is directly modified, the principle of one-way data flow will be violated, and the data flow will be chaotic, the code is difficult to maintain, and the data change is difficult to track.
To not modify the prop, emit an event that sends the changed status data to the parent component, which listens for the event emitted by the child component to fetch the updated value and apply it to the prop. As you can see, this process is a bit cumbersome, but the code logic is basically fixed, so Vue provides the syntactic sugar.sync to simplify the implementation of this requirement