When writing a plug-in, many times the child component needs to actively modify the value of the parent component or bind it.
At this time, it seems inappropriate to use pure parent-child component communication. It is better to let the parent component not operate data too much by itself, otherwise it will not be like a responsible component. At this time, the v-model sub-component is needed: this.$emit('custom attribute', data.ids
)
Parent component: <z-select @custom attribute='method'/>
How to write v-model parent component:
bind a data
How to write data data
v-model subcomponent:
Structure
There are two values in the model:{} in the subcomponent export default, prop means that I want to correspond to the variable of props, and event means an event. When I trigger the event cc, it will change the value of the parent component v-model.