【微信小程序】 監聽點擊底部tab 觸發的事件

 onTabItemTap 是和mouted 同級

 

<script>
export default{
 data () {
    return {
      showSendBtn: true,
      data: {
        code: '',
        tel: ''
      },
      sharePath: '',
      count: 60
    }
  },
  mounted () {},、
  onTabItemTap (item) {
    console.log(item.index)
    console.log(item.pagePath)
    console.log(item.text)
    let encryptedData = wxGetStorageSync('encryptedData')
    if (!encryptedData) {
      this.$router.replace({
        path: '/pages/login/phone/main'

      })
    }
  },
}
</script>

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章