删除对象里的某几项返回新对象

使用Lodash
 
var object = { 'a': 1, 'b': '2', 'c': 3 };
 
_.omit(object, ['a', 'c']);
// => { 'b': '2' }

 

方法一:

this.formInline = this._.omit(this.formInline, ['postList'])

 

方法二:

delete this.formInline.postList

posted @ 2021-02-01 11:45  hello芳芳  阅读(240)  评论(0编辑  收藏  举报