我有 2 个对象数组:
const headers1 = [
{text: 'ID', value: 'id', active: true},
{text: 'Name', value: 'name', active: true},
{text: 'Age', value: 'age', active: false},
{text: 'Address', value: 'address', active: true},
{text: 'Phone', value: 'phone', active: true}, //should be excluded because are not on headers2
]
和
const headers2 = [
{text: 'Name',value:'name', active: true},
{text: 'Age',value:'age', active: true},
{text: 'Address',value:'address', active: true},
{text: 'ID',value: 'id', active: true},
{text: 'Config',value: 'config', active: false}, //should be included at the end
{text: 'Options',value: 'options',active: true} //sould be included at the end
]
所以基本上我需要headers2从headers1. headers2未打开的项目headers1应放在最后。结果应该是这样的:
const headers3 = [
{text: 'ID', value: 'id', active: true},
{text: 'Name', value: 'name', active: true},
{text: 'Age', value: 'age', active: false},
{text: 'Address', value: 'address', active: true},
{text: 'Config', value: 'config', active: false},
{text: 'Options', value: 'options', active: true}
]
跃然一笑
慕沐林林
慕妹3146593
相关分类