diff --git a/src/MainContent.vue b/src/MainContent.vue index ebca3f1..bc6c386 100644 --- a/src/MainContent.vue +++ b/src/MainContent.vue @@ -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,