The vue child component modifies the value of the parent component

how can I change the value passed by the v-for loop of the parent component if the child component wants to modify it?

clipboard.png

clipboard.png
how do I modify this value? Because I don"t know the location of the value

Mar.12,2021

then you pass the location to the child component. When you need to modify it, notify the parent component to change it, and pass the data and index to


.

I only know that there are two types of

when I want to modify the props from the parent component in the child component.
  • by passing a callback on the child component, eg.
// par
<Par>
    <Child v-model="number" />
</Par>

// child
export default {
    model: {
        prop: number,
        event: 'handleChange',
    },
    props: ['number'],
    methods: {
        ['']() {
            this.$emit('handleChange', );
        }
    }
}

if there are other ways, you are welcome to communicate

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1bf3fb8-31407.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1bf3fb8-31407.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?