Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What if wx.hideMenuItems is not effective in html5 development?

2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article is about how to use wx.hideMenuItems invalid in html5 development. Xiaobian thinks it is quite practical, so share it with everyone for reference. Let's follow Xiaobian and have a look.

Solution: Put the wx.hideMenuItems() to be executed into wx.ready and it will take effect:

wx.config({ debug: true, //turn on debug mode, all api return values will be alerted on the client side, if you want to view the passed parameters, you can open it on the pc side, parameter information will be printed through log, only printed on the pc side. appId: '', //required, unique identifier of public number timestamp: , //required, timestamp of signature generation nonceStr: '', //required, random string of signature generation signature: '',//required, signature jsApiList: [] //required, JS interface list}); The ready method is executed after the// config message is verified. All interface calls must be performed after the config interface gets the result. Config is an asynchronous operation on the client side, so if you need to call the relevant interface when the page loads, you must put the relevant interface in the ready function to ensure correct execution. For interfaces that are called only when triggered by the user, they can be called directly without being placed in the ready function. wx.ready(function(){ //must be placed here to take effect wx.hideMenuItems( menuList: ['menuItem:share:appMessage'] );});/** Note: Wx.hideMenuItems() will not work if placed outside; */Thank you for reading! About "in html5 development using wx.hideMenuItems invalid how to do" This article is shared here, I hope the above content can be of some help to everyone, so that we can learn more knowledge, if you think the article is good, you can share it to let more people see it!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report