Merge two arrays in vue to switch routes and render repeatedly

use merging two arrays in vue to switch routes and render repeatedly

sources of topics and their own ideas

related codes

the first step is to get the data in the background and submit it to Store using vuex to merge the original data
let data = [

{
    name:"",
    id:"123"
}

]
this.$store.commit ("setYyuedata", data);

the second step is to merge the two data and render to the front
export default new Vuex.Store ({
state: {

)
yuyuedata:[],

},
getters: {

getYuyuedata: state => state.yuyuedata,

},
mutations: {

//
setYyuedata(state, data){
  state.yuyuedata = state.yuyuedata.concat(data);
}

}
})

part III, front end with new data
(1). Get state data
computed: {

        ...mapGetters([
            "getYuyuedata"
        ])

}
(2). Render to the page

< table > < / table > (3) The data is duplicated when switching routes. -sharp-sharp-sharp, what are you looking for? What is the error message actually seen? clipboard.pngclipboard.png
Dec.06,2021

should you use concat to assign the array directly when rendering? otherwise, if you enter the vuex twice and the data is not cleared, of course you will repeat it

.
Menu