小程序如何隐藏左上角返回首页按钮?

两种方法

方法一:
在页面的onShow或onLoad或onHide函数里调用wx.hideHomeButton()

onLoad(){
wx.hideHomeButton({
  complete:()=>{
    console.log("99999")
  }
})
}

方法二:
注册页面的pages.json里面写上"navigationStyle": "custom"

 {
          "path": "pages/myCourses/index",
          "style": {
            "navigationBarTitleText": "我的课程",
            "navigationStyle": "custom",
          }
}
Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐