From 2bf60fa8cbc994d233ca08f65d491a6b0e2b530d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8E=E8=82=96=E7=A3=8A?= <18851179580@163.com> Date: Fri, 13 Sep 2024 10:48:23 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=95=86=E5=93=81=E5=88=9D?= =?UTF-8?q?=E5=A7=8B=E5=8C=96=E6=97=B6=E7=9A=84=E6=95=B0=E6=8D=AE=E6=98=BE?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/model-goods-list/index.vue | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/components/model-goods-list/index.vue b/src/components/model-goods-list/index.vue index 9f0f4d6c..380a9ff1 100644 --- a/src/components/model-goods-list/index.vue +++ b/src/components/model-goods-list/index.vue @@ -229,10 +229,18 @@ const list = ref([]); onBeforeMount(() => { // 指定商品并且指定商品数组不为空 if (!isEmpty(form.value.data_list) && form.value.data_type == '0') { - list.value = form.value.data_list; + list.value = cloneDeep(form.value.data_list).map((item: any) => ({ + ...item.data, + title: !isEmpty(item.new_title) ? item.new_title : item.data.title, + new_cover: item.new_cover, + })); } else if (!isEmpty(form.value.data_auto_list) && form.value.data_type == '1') { // 筛选商品并且筛选商品数组不为空 - list.value = form.value.data_auto_list; + list.value = cloneDeep(form.value.data_auto_list).map((item: any) => ({ + ...item.data, + title: !isEmpty(item.new_title) ? item.new_title : item.data.title, + new_cover: item.new_cover, + })); } else { // 为空的时候走默认数据 list.value = Array(4).fill(default_list); }