Undefined error is reported when vue listens for array changes

when vue listens for array changes and assigns values to oldArray, oldArray prompts undefined

in the watch method, deep monitoring is used to listen for changes in newArray, and changes can be detected, but when assigning the changed value to oldArray, it prompts undefined

        data (){
            return {
                downloadUrl: (function () {
                    return "http://" + document.domain + ":38010"
                })(),
                oldImgs: this.$route.query.contractInfo,
                rowkey: this.$route.query.rowkey,
                copyLocalIds: [],
                newImgs:[],
                transLocalIds:[]
            }
        },
        created (){
            if (this.oldImgs && this.oldImgs.length > 0) {
                this.oldImgs = this.oldImgs.split(";");
                if (this.oldImgs[this.oldImgs.length-1] == "") {
                    this.oldImgs.pop();//
                }
                for (var i = 0; i < this.oldImgs.length; iPP) {
                    this.oldImgs[i] = this.downloadUrl+"/contractInfo"+this.oldImgs[i];
                }
            }
        },
        watch :{
            "newImgs":{
                deep: true,
                handler: (val,oldVal)=>{
                    console.log(":"+this.oldImgs);
                    if (this.oldImgs.length>0) {
                        this.oldImgs = this.oldImgs.concat(val);
                    } else {
                        this.oldImgs = val;
                    }
                    
                }
            }
        },
Apr.09,2021

suspected that the arrow function caused the this to be lost. Try using function instead.

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-1b3df38-2bb50.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-1b3df38-2bb50.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?