From c0235dc0ececec5353c044269fe750a56ddb0e13 Mon Sep 17 00:00:00 2001 From: sws <1141121512@qq.com> Date: Fri, 20 Sep 2024 15:57:04 +0800 Subject: [PATCH] =?UTF-8?q?1.diy---=E9=80=89=E9=A1=B9=E5=8D=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/diy/diy.vue | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/components/diy/diy.vue b/components/diy/diy.vue index 0d973743..a6ac962f 100644 --- a/components/diy/diy.vue +++ b/components/diy/diy.vue @@ -123,7 +123,7 @@ header_data: {}, footer_data: {}, // 选项卡数据 - tabs_data: [], + tabs_data: {}, diy_data: [], }; }, @@ -138,16 +138,15 @@ methods: { init() { // tabs选项卡数据过滤 - const filter_tabs_list = this.value.tabs_data; - if (filter_tabs_list.length > 0) { - this.setData({ - header_data: this.value.header, - footer_data: this.value.footer, - diy_data: filter_tabs_list.diy_data, - tabs_data: filter_tabs_list[0].com_data, - is_tabs: true, - }); - } + const filter_tabs_list = this.value.tabs_data || []; + this.setData({ + header_data: this.value.header, + footer_data: this.value.footer, + diy_data: this.value.diy_data, + tabs_data: filter_tabs_list.length > 0 ? filter_tabs_list[0].com_data : {}, + is_tabs: true, + }); + uni.setStorageSync('diy-data-' + this.propId, this.value.diy_data); }, footer_height_computer(number) { this.padding_footer_computer = number * 2; @@ -155,7 +154,7 @@ // 选项卡回调更新数据 tabs_click_event(data) { this.setData({ - tabs_data: data, + diy_data: data, }); }, },