原数据格式↓
const formInit = {
id: '',
name: '',
type: ''
}
const data = {
id: '123',
name: '你好',
type: '1',
updateTime: '2021-6-9',
updateBy: 'admin'
}
期待结果↓
const result = {
id: '123',
name: '你好',
type: '1'
}
就是我需要的是formInit的字段和相对应data的字段及value,像updateTime和updateBy这种formInit里面没有的字段就不要。
求大神们给个简便的方法
感谢各位大哥大姐的解答,小弟感激不尽!