var obj = { name: 'obj', fn: { add: true, edit: true
}}var page1 = { name: 'page1', fn: { edit: false
}}var config = Object.assign({}, obj, page1)// {name: 'page1', fn: {edit: false}}請問下我如何才能只覆蓋edit一個值呢?達到最終這個結(jié)果{name: 'page1', fn: {add:true, edit: false}}
Object.assign屬性拷貝
慕仙森
2018-09-01 20:44:48