[Vuejs]-Merging two Vuelidate objects into a single object

0👍

Hi you could try this piece of code

Object.keys(obj2).forEach(key => {
    if(key == '$model' || key == '$params') {
        Object.keys(obj2[key]).forEach(subKey => {
            obj1[key][subKey] = obj2[key][subKey]
        })
    } else 
    obj1[key] = obj2[key];
})

Leave a comment