From ed15a6b5708e3ef17721cfcb256df1cf0ddf07fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8E=E8=82=96=E7=A3=8A?= <18851179580@163.com> Date: Tue, 4 Mar 2025 11:08:44 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=BA=E7=A9=BA=E6=97=B6?= =?UTF-8?q?=E7=9A=84=E6=8A=A5=E9=94=99=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../diy/modules/custom/data-group-rendering.vue | 8 ++++++-- components/diy/modules/custom/data-rendering.vue | 14 +++++++++----- components/diy/tabs-carousel.vue | 4 ---- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/components/diy/modules/custom/data-group-rendering.vue b/components/diy/modules/custom/data-group-rendering.vue index b28ca0c7..1cfd7126 100644 --- a/components/diy/modules/custom/data-group-rendering.vue +++ b/components/diy/modules/custom/data-group-rendering.vue @@ -26,7 +26,7 @@ import modelLines from '@/components/diy/modules/custom/model-lines.vue'; import modelImage from '@/components/diy/modules/custom/model-image.vue'; import modelIcon from '@/components/diy/modules/custom/model-icon.vue'; import modelPanel from '@/components/diy/modules/custom/model-panel.vue'; -import { location_compute } from '@/common/js/common/common.js'; +import { location_compute, isEmpty } from '@/common/js/common/common.js'; export default { components: { modelText, @@ -112,7 +112,7 @@ export default { watch: { propKey(val) { // 初始化 - this.init(); + this.init(this.propCustomList); }, propCustomList(val) { this.init(val); @@ -173,6 +173,10 @@ export default { }, methods: { async init(val) { + // 如果为空就不进行渲染 + if (isEmpty(val)) { + return; + } await this.get_custom_width(); this.set_new_list(val); }, diff --git a/components/diy/modules/custom/data-rendering.vue b/components/diy/modules/custom/data-rendering.vue index 34ec2373..bb7b69f2 100644 --- a/components/diy/modules/custom/data-rendering.vue +++ b/components/diy/modules/custom/data-rendering.vue @@ -30,7 +30,7 @@ import modelImage from '@/components/diy/modules/custom/model-image.vue'; import modelIcon from '@/components/diy/modules/custom/model-icon.vue'; import modelPanel from '@/components/diy/modules/custom/model-panel.vue'; import modelCustomGroup from '@/components/diy/modules/custom/model-custom-group.vue'; -import { location_compute } from '@/common/js/common/common.js'; +import { location_compute, isEmpty } from '@/common/js/common/common.js'; export default { components: { modelText, @@ -123,7 +123,7 @@ export default { watch: { propKey(val) { // 初始化 - this.init(); + this.init(this.propCustomList); }, }, computed: { @@ -177,12 +177,16 @@ export default { } }, mounted() { - this.init(); + this.init(this.propCustomList); }, methods: { - async init() { + async init(val) { + // 如果为空就不进行渲染 + if (isEmpty(val)) { + return; + } await this.get_custom_width(); - this.set_new_list(this.propCustomList); + this.set_new_list(val); }, get_custom_width() { // 获取当前容器的宽度 diff --git a/components/diy/tabs-carousel.vue b/components/diy/tabs-carousel.vue index 5de41101..22ec5672 100644 --- a/components/diy/tabs-carousel.vue +++ b/components/diy/tabs-carousel.vue @@ -173,10 +173,6 @@ swiper_bg_style: this.get_swiper_bg_style(new_content, 0), swiper_bg_img_style: this.get_swiper_bg_img_style(new_content, 0), }); - console.log( - app.globalData.px_to_rpx(100) - ); - }, // tab点击 tabs_click_event(tabs_id, is_micro_page) {