修复页面刷新sketch会增加和颜色板块关闭后再次打开颜色异常问题
This commit is contained in:
@@ -136,7 +136,7 @@ export default defineComponent({
|
||||
data(){
|
||||
return{
|
||||
imgOpen:true,
|
||||
|
||||
setSketchTime:null as any,
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@@ -153,12 +153,18 @@ export default defineComponent({
|
||||
newArr.push(newVal?.[index]?.id?newVal?.[index]?.id:newVal?.[index]?.sketchBoardIdd)
|
||||
});
|
||||
if(JSON.stringify(newArr)!=JSON.stringify(oldArr)){
|
||||
this.setSketch()
|
||||
clearTimeout(this.setSketchTime)
|
||||
this.setSketchTime = setTimeout(()=>{
|
||||
this.setSketch()
|
||||
},500)
|
||||
this.imgOpen = true
|
||||
}
|
||||
}else{
|
||||
nextTick(()=>{
|
||||
this.setSketch()
|
||||
clearTimeout(this.setSketchTime)
|
||||
this.setSketchTime = setTimeout(()=>{
|
||||
this.setSketch()
|
||||
},500)
|
||||
this.imgOpen = true
|
||||
})
|
||||
}
|
||||
@@ -201,6 +207,7 @@ export default defineComponent({
|
||||
let sketchH = [0,0,0]
|
||||
nextTick().then(async ()=>{
|
||||
if(this.sketchList && this.sketchList!=null){
|
||||
console.log(JSON.parse(JSON.stringify(this.sketch)),JSON.parse(JSON.stringify(this.sketchList)))
|
||||
for (let i = 0; i < this.sketchList?.length; i++) {
|
||||
let sketch1:any = document.getElementsByClassName('collection_review')[0]?.getElementsByClassName('lager_img_item0')[0]?.getBoundingClientRect()
|
||||
let sketch2:any = document.getElementsByClassName('collection_review')[0]?.getElementsByClassName('lager_img_item1')[0]?.getBoundingClientRect()
|
||||
@@ -232,6 +239,7 @@ export default defineComponent({
|
||||
}
|
||||
})
|
||||
}
|
||||
console.log(JSON.parse(JSON.stringify(this.sketch)))
|
||||
this.imgOpen = true
|
||||
this.store.commit('setshowSketchList', this.sketch)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user