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