微信内h5页面打开小程序【详细教程】

相关配置

  1. 微信js文件版本大于等于1.6.0
    https://res.wx.qq.com/open/js/jweixin-1.6.0.js
  2. 微信授权配置

    window.wx.config({
    ...otherConfig,
    openTagList: [‘wx-open-launch-weapp‘]
    })
  3. 调用示例

    const style = {
    position: ‘absolute‘,
    top: 0,
    right: 0,
    bottom: 0,
    left: 0,
    };
    function OpenWeapp({ originId, pagePath }) {
    return (
    <wx-open-launch-weapp username={originId} path={pagePath} style={style}>
    <script type="text/wxtag-template">
    <div style={style} />
    </script>
    </wx-open-launch-weapp>
    );
    }
    // 使用方式
    <div style={{ position: ‘relative‘ }}>
    点击跳转小程序
    <OpenWeapp originId="gh_xxxxxxxx" pagePath="pages/home/index?user=123&action=abc" />
    </div>

微信内h5页面打开小程序【详细教程】

原文:https://www.cnblogs.com/crack1/p/15207577.html

以上是微信内h5页面打开小程序【详细教程】的全部内容。
THE END
分享
二维码
< <上一篇
下一篇>>