My code includes an array with nested elements that depend on data properties. I'm trying to make it reactive, but for some reason it's not updating when the data properties change. I've tried setting and getting Vue observer sets for these properties, such as this.errorData.isNotServerError = true. However, the properties in the array remain unchanged. I'm using Typescript with Vue.
'''
private baseErrorLabelList = [
{
condition: this.errorData.isNotServerError,
text: this.$root.$t('login.error_label.not_server_error'),
},
];
'''
This is the array mentioned above.
'''
private emptyErrorData = {
isIncorrectDataProvided: false,
isServerError: false,
isNotServerError: false,
};
private userData = Object.assign({}, this.emptyUserData);
public errorData = Object.assign({}, this.emptyErrorData);
'''
These are the data properties used.
Even without using Object.assign, the issue persists.