See below the following context and method. But when the method is triggered both objects (operator
and newOperator
) are updated instead of only the one that is assigned in the method (newOperator
). Am I doing something wrong?
export default {
data() {
return {
operator: {},
newOperator: {}
};
},
methods: {
updateContext(e) {
let self = this
var t = e.target;
var c = self.newOperator;
switch (t.name) {
case 'displayName':
c.displayName = t.value;
break;
default:
}
self.$update();
}
}