線上文檔地址:https://developers.weixin.qq.com/doc/offiaccount/OA_Web_Apps/Wechat_Open_Tag.html
H5頁面新加標簽"wx-open-launch-weapp"
app頁面新加標簽:‘wx-open-launch-app’
首先先配置,並且引用<script type="text/javascript" src="//res2.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
頁面上:其中
username:gh_開頭的原始id,
path:小程序的首頁,務必加上.html的后綴
<wx-open-launch-weapp id="launch-btn" username="gh_XXXXXXXXXXXXX path="pages/index/index.html" > <template> <style>.btn { padding: 12px }</style> <button class="btn a_href_1">打開小程序</button> </template> </wx-open-launch-weapp>