edit: simplification highlight sans array intermédiaire
This commit is contained in:
+4
-16
@@ -295,22 +295,10 @@ import { toRaw } from 'vue'
|
||||
console.log(this.marjTop,this.marjBot,this.marjSide);
|
||||
},
|
||||
selectHighlight(){
|
||||
let index = [];
|
||||
let hClass = [];
|
||||
for(let k=0; k<this.isHighlight.length; k++){
|
||||
index.splice(k,0,this.isHighlight[k][0]);
|
||||
hClass.splice(k,0,this.isHighlight[k][1]);
|
||||
};
|
||||
console.log(index,hClass);
|
||||
for (let i=0; i<this.items.length; i++){
|
||||
let selectedItem = this.items[i].id;
|
||||
if (index.includes(selectedItem)){
|
||||
let selectIndex = index.indexOf(selectedItem);
|
||||
this.items[i].isHighlight = hClass[selectIndex];
|
||||
}else{
|
||||
continue
|
||||
}
|
||||
}
|
||||
this.isHighlight.forEach(([id, level]) => {
|
||||
const item = this.items.find(item => item.id === id);
|
||||
if (item) item.isHighlight = level;
|
||||
});
|
||||
console.log(this.items)
|
||||
},
|
||||
selectRandomGraffs(){
|
||||
|
||||
Reference in New Issue
Block a user