深拷贝浅拷贝 遇到了bug

 你只要知道浅拷贝 你修改被赋值数据 原来的数据 也会被修改就行了

launch () {
            // console.log('选中的:', this.mixData.addData)
            this.modal.show = false
            console.log(this.mixData.addData)
            this.showData = _.cloneDeep(this.mixData.addData)  // 这里要深拷贝
            this.checkIfOverflow()
            this.$emit('launch', this.mixData.addData)
        },

猜你喜欢

转载自www.cnblogs.com/benbendu/p/10458059.html