diff --git a/src/component/Detail/DesignDetailAlter.vue b/src/component/Detail/DesignDetailAlter.vue index 3afdd46f..bcccda81 100644 --- a/src/component/Detail/DesignDetailAlter.vue +++ b/src/component/Detail/DesignDetailAlter.vue @@ -917,7 +917,7 @@ export default defineComponent({ this.colorList[this.selectIndex].gradient = JSON.parse(JSON.stringify(this.gradient)) }else{ this.selectColor = {rgba:this.colorList[this.selectIndex].gradient.gradientList[0].rgba} - this.colorList[this.selectIndex].gradient = '' + this.colorList[this.selectIndex].gradient = {} } let colorList =this.colorList.filter((v) => v && Object.keys(v).length) }, diff --git a/src/component/HomePage/ColorboardUpload.vue b/src/component/HomePage/ColorboardUpload.vue index cd59b25e..f64d6ebb 100644 --- a/src/component/HomePage/ColorboardUpload.vue +++ b/src/component/HomePage/ColorboardUpload.vue @@ -771,7 +771,7 @@ export default defineComponent({ this.colorList[this.selectIndex].gradient = JSON.parse(JSON.stringify(this.gradient)) }else{ this.selectColor = {rgba:this.colorList[this.selectIndex].gradient.gradientList[0].rgba} - this.colorList[this.selectIndex].gradient = '' + this.colorList[this.selectIndex].gradient = {} } let colorList =this.colorList.filter((v) => v && Object.keys(v).length) this.setColorboardList(colorList) diff --git a/src/component/WorksPage/Falls.vue b/src/component/WorksPage/Falls.vue index 00773bd7..daf9b6fe 100644 --- a/src/component/WorksPage/Falls.vue +++ b/src/component/WorksPage/Falls.vue @@ -83,6 +83,7 @@ export default defineComponent({ let poss = ref([]) let loading = ref(false) let computedHeight = 0 + let imgDom = ref() return{ list, wait_list, @@ -93,6 +94,7 @@ export default defineComponent({ poss, loading, computedHeight, + imgDom, } }, directives:{ @@ -146,6 +148,7 @@ export default defineComponent({ // 挂载方法 methods: { clearData(){ + this.wait_list = [] this.width = 300 this.num_x = 1 this.gap_x = 0 @@ -154,6 +157,10 @@ export default defineComponent({ this.loading = false this.list = [] this.resize() + if(this.imgDom){ + this.imgDom.remove(); + this.imgDom = null + } }, push(arr) { this.wait_list = this.wait_list.concat(arr); @@ -180,14 +187,15 @@ export default defineComponent({ let url = this.wait_list[0].canvasUrl; let data = this.wait_list[0] - let img = document.createElement("img"); - img.src = url; - img.style.width = this.width + "px"; - img.style.maxHeight = this.width+330 + "px"; - img.style.position = "absolute"; - img.style.top = "-99999px"; - document.body.appendChild(img); - img.addEventListener("load", () => { + this.imgDom = document.createElement("img"); + this.imgDom.src = url; + this.imgDom.style.width = this.width + "px"; + this.imgDom.style.maxHeight = this.width+330 + "px"; + this.imgDom.style.position = "absolute"; + this.imgDom.style.top = "-99999px"; + document.body.appendChild(this.imgDom); + this.imgDom.addEventListener("load", () => { + if(!this.imgDom) return var idx = 0; var pos_num = this.poss[idx]; for (var i = 1; i < this.poss.length; i++) { @@ -196,8 +204,8 @@ export default defineComponent({ pos_num = this.poss[i]; } } - let width = img.offsetWidth; - let height = img.offsetHeight+this.computedHeight; + let width = this.imgDom.offsetWidth; + let height = this.imgDom.offsetHeight+this.computedHeight; let top = this.poss[idx] + this.gap_y; let left = (idx + 1) * this.gap_x + idx * width; let imgHeight = height - this.computedHeight @@ -208,7 +216,8 @@ export default defineComponent({ ...data }; this.list.push(obj); - img.remove(); + this.imgDom.remove(); + this.imgDom = null this.wait_list.splice(0, 1); this.$el.style.height = Math.max(...this.poss) + this.gap_y + "px"; diff --git a/src/views/HomeView/Works.vue b/src/views/HomeView/Works.vue index 8c9c472b..51dc512d 100644 --- a/src/views/HomeView/Works.vue +++ b/src/views/HomeView/Works.vue @@ -156,8 +156,8 @@ export default defineComponent({ filter.isNull = false } if (rv.content.length > 0) { - filter.isNull = false - fall.value.push(rv.content); + filter.isNull = false + fall.value.push(rv.content); } else { filter.isNoData = true }