fix update config

This commit is contained in:
Rodrigo Quelca
2021-09-24 17:56:33 +00:00
parent d36569bc54
commit e9e1eb9701

View File

@@ -43,7 +43,8 @@ export default {
visited: this.settings && this.settings.visited ? this.settings.visited : [
{
level: 0,
active: true
active: true,
id: _.random(0,100),
}
]
};
@@ -60,16 +61,18 @@ export default {
* Change level in drill down
*/
changeLevel(data) {
let item = _.find(this.visited, {level: data.level });
let item = _.find(this.visited, data);
this.visited.forEach(function (elem) {
elem.active = false;
});
if(!item) {
data.active = true;
this.visited = _.filter(this.visited, function(o) {
return o.level < data.level;
});
this.visited.push(data);
} else {
item.active = true;
}
this.$emit("updateSettings", {
data: this.visited,