From 99cdcd5d19ed205ffcd83bedaf3567ebc53621c7 Mon Sep 17 00:00:00 2001 From: "@AliceXiaoZhan" <1936165216@qq.com> Date: Tue, 8 Aug 2023 16:50:04 +0800 Subject: [PATCH] =?UTF-8?q?tab=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/tab/tab.vue | 11 +++++++++-- components/tabs/tabs.vue | 1 + pages/resource_list/resource_list.vue | 6 ++++-- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/components/tab/tab.vue b/components/tab/tab.vue index 2da702d..49078de 100644 --- a/components/tab/tab.vue +++ b/components/tab/tab.vue @@ -24,14 +24,21 @@ shouldRender: false } }, - created() { - this.tabs.childrens.push(this) + created(){ + console.log('this----------------') + console.log(this.tabs.childrens) + this.tabs.childrens=[] }, + // mounted () { + // this.tabs.childrens.push(this) + // }, mounted() { + this.tabs.childrens.push(this) this.update() }, methods: { getComputedName: function() { + if (this.data.name !== '') { return this.data.name; } diff --git a/components/tabs/tabs.vue b/components/tabs/tabs.vue index 3374371..cdf8656 100644 --- a/components/tabs/tabs.vue +++ b/components/tabs/tabs.vue @@ -256,6 +256,7 @@ }, methods: { updateTabs() { + console.log(this.childrens) this.list = this.childrens.map((item) => { const { name, diff --git a/pages/resource_list/resource_list.vue b/pages/resource_list/resource_list.vue index 25765dc..a9d1479 100644 --- a/pages/resource_list/resource_list.vue +++ b/pages/resource_list/resource_list.vue @@ -201,6 +201,8 @@ }, async downCallback() { await this.getCategoryListFun(); + console.log("后续值",this.categoryList) + console.log("后续值2",this.cid) this.mescroll.resetUpScroll(); }, upCallback(page) { @@ -265,13 +267,13 @@ this.$set(this.categoryList, index, item); }); }); - console.log("后续值",this.categoryList) - console.log("后续值2",this.cid) + this.categoryList.forEach((item, index) => { if(this.cid>0 && item.id == this.cid){ this.active = index+1 } }) + }, }, computed: {