H5 page jump applet in WeChat

version requirements

WeChat version requirements: 7.0.12 and above.

The system version requirements are: iOS 10.3 and above, Android 5.0 and above.

Wechat sdk version needs to be 1.6.0 and above

Open WeChat Mini Program Open Tab

wx-open-launch-weapp

open object

The certified service account, the service account is bound to the webpage under the "JS interface security domain name", and this label can be used to jump to any legal and compliant applet.

The certified non-personal Mini Program uses the static website developed by Mini Program Cloud to host webpages under the bound domain name. This tag can be used to jump to any legal and compliant Mini Program.

Instructions for use

All open tags can be used directly in the page like ordinary HTML tags without additional processing.

If the tag used allows slots, since the template styles in the slots are isolated from the page, care should be taken to define the template styles in the slots. Both slot templates and styles need to be packaged. In addition, for a named slot, the slot name needs to be declared through the slot attribute. The default slot in the label slot below is the default slot, and the slot name can not be declared.

For label events, detailed information can be obtained through event.detail. Unless otherwise specified, the return values ​​in the label event description below refer to the content in event.detail.

Related parameter configuration

Attributes

name required Remark
username yes The original id of the applet to be redirected, that is, the id starting with gh_ corresponding to the applet
path no The page path and parameters in the applet to be redirected

slot

name required Remark
default yes Jump button template and style
<wx-open-launch-weapp id="launch-btn" username="gh_ce3adf9da091" path="pages/index/index"></wx-open-launch-weapp>

If used in a Vue project, because the wx-open-launch-weapp tag is not recognized by Vue,
Vue must ignore custom elements outside of Vue (eg using Web Components APIs). Otherwise, it will assume that you forgot to register the global component or misspelled the component name, thus throwing a warning about Unknown custom element.
The following code configuration needs to be added in main.js (ignore this tag)
Vue.config.ignoredElements = ['wx-open-launch-weapp']

For the complete code demo, follow the WeChat public account
Reply [H5 Jump Mini Program-jq] Get the Jquery version demo
Reply [H5 Jump Mini Program-vue] Get the Vue version demo

Official account QR code.jpg

If you find it useful, please give it a thumbs up, thank you

Follow me and share technical dry goods from time to time~

Guess you like

Origin blog.csdn.net/weixin_45295253/article/details/116043941