删除对象中的元素的方法

this.copyData = Object.assign({}, this.$route.params.data, {
id: undefined,
code: undefined,
createTime: undefined,
statusDesc: undefined,
})
将对象中的属性设置为undefined相当于删除

猜你喜欢

转载自www.cnblogs.com/wszxx/p/9268300.html