uniapp如何监听tabbar切换事件

3,880 阅读1分钟

只需要在tabbar页面级文件的js中加入以下函数即可:

/** 
* 监听 TabBar 切换点击 
*/ 
onTabItemTap: function (item) { 
    console.log(item) 
}