solve: bug#1 => problème de référence multiples dans les array et leurs copies réglés avec [...] et structuredCLone => problème d'ID chiffré en double entre img et graff réglé avec ajout de 'img-' et 'graff-'
task#1: finir formulaire contact (mail + captcha ?) task#2: génération multicollection + fond assortis task#3: supprimer ou modifier colorBtn task#4: responsive hauteur (autour de 1080px ?)
This commit is contained in:
+8
-8
@@ -314,13 +314,13 @@ import { toRaw } from 'vue'
|
||||
c = this.getRandomInt(0,graffCount);
|
||||
} while (a == c || c == b);
|
||||
console.log(a,b,c);
|
||||
this.items.push(this.graffs[a],this.graffs[b],this.graffs[c]);
|
||||
this.randomItems.push({...this.graffs[a]},{...this.graffs[b]},{...this.graffs[c]});
|
||||
},
|
||||
generateContent(){
|
||||
console.log(this.items);
|
||||
console.log("before gen:",this.items);
|
||||
this.randomItems = structuredClone(toRaw(this.items)).sort(() => Math.random()-0.5);
|
||||
this.selectRandomGraffs();
|
||||
this.randomItems = this.items.sort(() => Math.random()-0.5),
|
||||
console.log(this.randomItems);
|
||||
console.log("random + graff:",this.randomItems);
|
||||
this.maxItemCount = this.randomItems.length;
|
||||
this.divideItem();
|
||||
this.createEmptyArray();
|
||||
@@ -328,7 +328,7 @@ import { toRaw } from 'vue'
|
||||
this.genCoord(this.partOneItem);
|
||||
this.genCoord(this.partTwoItem);
|
||||
this.genCoord(this.partThreeItem);
|
||||
console.log('Content has been generated!')
|
||||
console.log('Content has been generated!');
|
||||
}
|
||||
},
|
||||
data(){
|
||||
@@ -338,20 +338,20 @@ import { toRaw } from 'vue'
|
||||
const graffData = Object.values(impGraff);
|
||||
return{
|
||||
items: imgData.map((src, index) => ({
|
||||
id: index,
|
||||
id: "img-" + index,
|
||||
src: src,
|
||||
x: 0,
|
||||
y: 0,
|
||||
isHighlight: 0
|
||||
})),
|
||||
graffs: graffData.map((src, index) => ({
|
||||
id: index,
|
||||
id: "graff-" + index,
|
||||
src: src,
|
||||
x: 0,
|
||||
y: 0,
|
||||
isHighlight: 3
|
||||
})),
|
||||
isHighlight:[[2,1],[6,1],[11,2]],
|
||||
isHighlight:[['img-2',1],['img-6',1],['img-11',2]],
|
||||
randomItems: null,
|
||||
maxItemCount: 0,
|
||||
marjTop:0,
|
||||
|
||||
Reference in New Issue
Block a user