fix
This commit is contained in:
@@ -79,7 +79,9 @@ import { useStore } from "vuex";
|
||||
export default defineComponent({
|
||||
components:{MoodTemplate},
|
||||
setup() {
|
||||
let sketch:any = ref([[],[],[]])
|
||||
let sketch:any = computed(()=>{
|
||||
return store.state.HomeStoreModule.showSketchList})
|
||||
// let sketch:any = ref([[],[],[]])
|
||||
let sketchList:any = computed(()=>{
|
||||
return store.state.UploadFilesModule.showSketchboard})
|
||||
const store = useStore();
|
||||
@@ -97,10 +99,7 @@ export default defineComponent({
|
||||
watch: {
|
||||
sketchList:{
|
||||
handler(newVal:any,oldVal:any){
|
||||
// this.sketchList = []
|
||||
// this.sketch = [[],[],[]]
|
||||
// this.sketchList = this.allBoardData.sketchboardFiles
|
||||
this.setSketch()
|
||||
// this.setSketch()
|
||||
},
|
||||
immediate: true
|
||||
},
|
||||
@@ -130,11 +129,13 @@ export default defineComponent({
|
||||
sketch1.num = 0
|
||||
sketch2.num = 1
|
||||
sketch3.num = 2
|
||||
let aaa = JSON.parse(JSON.stringify(this.sketchList))
|
||||
if(this.sketchList){
|
||||
for (let i = 0; i < this.sketchList.length; i++) {
|
||||
for (let i = 0; i < aaa.length; i++) {
|
||||
let arr = [sketch1,sketch2,sketch3]
|
||||
|
||||
let image = new Image()
|
||||
image.src = this.sketchList[i].urlWithWhiteSide
|
||||
image.src = aaa[i].urlWithWhiteSide
|
||||
|
||||
arr.sort((a,b)=>{
|
||||
var a_num = a["height"];
|
||||
@@ -142,7 +143,7 @@ export default defineComponent({
|
||||
return a_num - b_num;
|
||||
})
|
||||
// console.log(arr);
|
||||
this.sketch[arr[0].num]?.push(this.sketchList[i])
|
||||
this.sketch[arr[0].num]?.push(aaa[i])
|
||||
// console.log([sketch1.height,sketch2.height,sketch3.height]);
|
||||
await new Promise((resolve:any)=>{
|
||||
image.onload = ()=>{
|
||||
@@ -150,7 +151,6 @@ export default defineComponent({
|
||||
sketch1 = document.getElementsByClassName('collection_review')[0]?.getElementsByClassName('lager_img_item0')[0]?.getBoundingClientRect()
|
||||
sketch2 = document.getElementsByClassName('collection_review')[0]?.getElementsByClassName('lager_img_item1')[0]?.getBoundingClientRect()
|
||||
sketch3 = document.getElementsByClassName('collection_review')[0]?.getElementsByClassName('lager_img_item2')[0]?.getBoundingClientRect()
|
||||
|
||||
sketch1.num = 0
|
||||
sketch2.num = 1
|
||||
sketch3.num = 2
|
||||
@@ -161,7 +161,6 @@ export default defineComponent({
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -281,6 +280,9 @@ export default defineComponent({
|
||||
height: auto;
|
||||
>div{
|
||||
margin-bottom: 2rem;
|
||||
img{
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
>div:nth-child(1){
|
||||
|
||||
Reference in New Issue
Block a user