Posts Vue.js Deepcopy
Post
Cancel

Vue.js Deepcopy

Mapping objects into new ones

Parent
1
<child-component :passed-data="arrData"></child-component>
Child
1
2
3
4
5
6
7
8
9
10
11
12
13
14
export default {
    props: {
        passedData: {
            type: Array,
            required: true
        }
    },
    data() {
        return {
            localData: this.projects.map(x => ({...x})),
        }
    }
}

This post is licensed under CC BY 4.0 by the author.