my.hideBackHome
Use this API to hide the home button in the top navigation bar, and the return-home option in the tab bar in the upper right corner.
Notes:
- By default, the home button is displayed if the page where an user enters on starting the Mini Program is not the homepage.
- If the tab bar is configured to redirect to pages/index/index in the app.json, the return-home option is not displayed.
Sample Code
copy
//.js
Page({
onReady() {
if (my.canIUse('hideBackHome')) {
my.hideBackHome();
}
},
});
copy
//.js
onLoad(){
my.reLaunch({
url:'../swiper/swiper'// An added page other than the homepage
})
setTimeout(() => {
//Hide the home button after 5 seconds
my.hideBackHome()
}, 5000)
}