The problem of Vue sub-component modifying props

clipboard.png
modal1

clipboard.png
subcomponents are bound with v-model, and I will report an error when I close it. How to solve this

Mar.10,2021

vue data is one-way, you can not change the data sent to you by others, only through the event trigger


first agree to answer upstairs, and secondly, your code is not comprehensive, you can post the methods-related logic.
you can understand that props is the communication between the parent component and the child component. If you change modal1 , modal1 is the data of the parent component, which is equivalent to the communication between the child component and the parent component, you need to use $on and $emit to trigger the event and pass the data through callback

.
Menu