相关配置都正常,vue项目中应用,但是页面中就是无法显示拉起小程序的按钮,拉起app的按钮及功能都正常,
页面链接:https://activity.wandougongzhu.cn/wxdemo.html
<div class="btn-item">
<wx-open-launch-weapp
style="position:absolute;top:0;left:0;right:0;bottom:0;text-align: center;"
id="launch-btn-wx"
username="gh_2009800a5713"
>
<script type="text/wxtag-template">
<style>.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="btn">打开豌豆公主小程序</button>
</script>
</wx-open-launch-weapp>
</div>
<div class="btn-item">
<wx-open-launch-app
id="launch-btn"
appid="wx44c7c3333f79f26b"
style="position:absolute;top:0;left:0;right:0;bottom:0;"
>
<script type="text/wxtag-template">
<style>.btn {width: 200px; height: 40px; text-align: center; line-height: 40px; font-size: 16px; border-radius: 20px; background: #3579d0; color:#fff; border: 0;}</style>
<button class="btn">打开豌豆公主APP</button>
</script>
</wx-open-launch-app>
</div>
https://blog.csdn.net/CherryCola_zjl/article/details/111165702 亲测可用
https://github.com/towry/n/issues/152
按照微信官网的模板写,按钮不显示,怎么回事
非个人打开有按钮:
https://develop-7grwamgn1ae3dc23-1305068253.tcloudbaseapp.com/test-open-miniapp.html
个人打开没有按钮:
https://production-9gvn1ik514081c68-1305509305.tcloudbaseapp.com/test-open-miniapp.html
被这个问题困扰好久了,脑壳疼~
https://juejin.im/post/6868526637458128903 跳转总结文章,有问题可以看看
请问,楼主这个问题解决了吗?
https://adv-yiye-test1.bicai365.com/h5api/smallApp.html
wx-open-launch-weapp
在微信中没有按钮
wx-open-launch-weapp标签你没写path属性
要在微信中打开
我这测试可以
<wx-open-launch-weapp
id="launch-btn"
username="gh_xxxxxxxx"
path="pages/home/index.html?user=123&action=abc"
>
<template>
<style>.btn { padding: 12px }</style>
<button class="btn">打开小程序</button>
</template>
</wx-open-launch-weapp>
<script>
var btn = document.getElementById('launch-btn');
btn.addEventListener('launch', function (e) {
console.log('success');
});
btn.addEventListener('error', function (e) {
console.log('fail', e.detail);
});
</script>