$emit
This commit is contained in:
@@ -170,7 +170,7 @@ export default {
|
|||||||
uni.switchTab({
|
uni.switchTab({
|
||||||
url: '/pages/AppLegalLearning/AppLegalLearning',
|
url: '/pages/AppLegalLearning/AppLegalLearning',
|
||||||
success: ()=> {
|
success: ()=> {
|
||||||
uni.setStorageSync('inx', index)
|
uni.$emit('update',{inx: index})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -35,11 +35,9 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
console.log(uni.getStorageSync('inx'),'index');
|
uni.$once('update',(data)=> {
|
||||||
if(uni.getStorageSync('inx')) {
|
this.currIndex = data.inx
|
||||||
console.log(uni.getStorageSync('inx'), 'inx');
|
})
|
||||||
this.currIndex = uni.getStorageSync('inx')
|
|
||||||
}
|
|
||||||
if(this.currIndex == 0) {
|
if(this.currIndex == 0) {
|
||||||
this.$refs.OnlineClass.getList();
|
this.$refs.OnlineClass.getList();
|
||||||
} else {
|
} else {
|
||||||
@@ -52,9 +50,6 @@ export default {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
onHide() {
|
|
||||||
uni.removeStorageSync('inx')
|
|
||||||
},
|
|
||||||
components: {
|
components: {
|
||||||
OnlineClass,
|
OnlineClass,
|
||||||
GeneralLawExam
|
GeneralLawExam
|
||||||
|
|||||||
Reference in New Issue
Block a user