Browse Source

tab修改

master
@AliceXiaoZhan 3 years ago
parent
commit
99cdcd5d19
  1. 11
      components/tab/tab.vue
  2. 1
      components/tabs/tabs.vue
  3. 6
      pages/resource_list/resource_list.vue

11
components/tab/tab.vue

@ -24,14 +24,21 @@
shouldRender: false shouldRender: false
} }
}, },
created() { created(){
this.tabs.childrens.push(this) console.log('this----------------')
console.log(this.tabs.childrens)
this.tabs.childrens=[]
}, },
// mounted () {
// this.tabs.childrens.push(this)
// },
mounted() { mounted() {
this.tabs.childrens.push(this)
this.update() this.update()
}, },
methods: { methods: {
getComputedName: function() { getComputedName: function() {
if (this.data.name !== '') { if (this.data.name !== '') {
return this.data.name; return this.data.name;
} }

1
components/tabs/tabs.vue

@ -256,6 +256,7 @@
}, },
methods: { methods: {
updateTabs() { updateTabs() {
console.log(this.childrens)
this.list = this.childrens.map((item) => { this.list = this.childrens.map((item) => {
const { const {
name, name,

6
pages/resource_list/resource_list.vue

@ -201,6 +201,8 @@
}, },
async downCallback() { async downCallback() {
await this.getCategoryListFun(); await this.getCategoryListFun();
console.log("后续值",this.categoryList)
console.log("后续值2",this.cid)
this.mescroll.resetUpScroll(); this.mescroll.resetUpScroll();
}, },
upCallback(page) { upCallback(page) {
@ -265,13 +267,13 @@
this.$set(this.categoryList, index, item); this.$set(this.categoryList, index, item);
}); });
}); });
console.log("后续值",this.categoryList)
console.log("后续值2",this.cid)
this.categoryList.forEach((item, index) => { this.categoryList.forEach((item, index) => {
if(this.cid>0 && item.id == this.cid){ if(this.cid>0 && item.id == this.cid){
this.active = index+1 this.active = index+1
} }
}) })
}, },
}, },
computed: { computed: {

Loading…
Cancel
Save