收藏
回答

wx-open-launch-weapp在React中使用 在安卓上不显示?

开放标签:wx-open-launch-weapp

机型:VIVO x21 和oppo A9

微信版本号:7.0.17和7.0.15

系统:安卓9

问题描述:ios没问题,开启debug时有弹窗提示config ok,按钮可以显示,可以跳转.安卓开启debug有弹窗提示config ok,按钮无法显示.

可复现地址:http://renderer.test.rabbitpre.com/m3/aUe1Zi9ccg

代码如下:

var page = document.querySelector("body");
var openTags = document.createElement("wx-open-launch-weapp");
var username = "gh_xxxxx";
var path = "pages/index/index.html";
var judge = false;
openTags.innerHTML = `<template>  <style>.wx-btn {width: 200px; height: 40px; text-align: center; line-height: 40px; font-size: 16px; border-radius: 20px; background: #62c655; color:#fff; border: 0;}
                                style><button class="wx-btn">打开小程序button>template>`;


openTags.setAttribute("username", username);
openTags.setAttribute("path", `${path}`);
page.appendChild(openTags);


回答关注问题邀请回答
收藏

1 个回答

  • 疯狂的小辣椒
    疯狂的小辣椒
    2020-08-20

    你好,查到是被你们的csp拦截了,请参考文档配置一下csp规则

    2020-08-20
    有用 1
    回复
登录 后发表内容
问题标签