-
The.sync modifier in Vue is an important syntactic sugar for quick communication between components
-
When all we need to do is have the child component change the state of the parent, the code is easier to tell that it will be extended to a V-ON listener that automatically updates the parent component’s properties
-
$emit = $emit = $emit = $emit = $emit = $emit = $emit = $emit = $emit = $emit = $emit = $emit = $emit = $emit = $emit = $emit = $emit = $emit = $emit = $emit = $emit = $emit = $emit = $emit = $emit = $emit = $emit = $emit
<Child :money="total" v-on:update:money="total = $event"/>
Copy the code
- If.sync is used
<Child :money.sync="total"/>
Copy the code
- Please click the link for specific cases
Codesandbox. IO/s/laughing -…