uniapp vue3 getTabbar undefined

在做自定义tabbar的时候发现无法使用微信小程序的getTabbar

记录一下Vue3需要的代码

const curPages = getCurrentPages()[0];  // 获取当前页面实例  
if (typeof curPages.getTabBar === 'function' && curPages.getTabBar()) {  
    curPages.getTabBar().setData({  
        selected: 2  
    });  
}
Avatar photo
About the Author:
记录生活点滴

Related Posts

Leave a Comment!

You must be logged in to post a comment.