官方文档给出的代码是
<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>
然在Vue项目中template标签和vue的template标签冲突需要使用 <script type="text/wxtag-template">标签
<wx-open-launch-weapp id="launch-btn" username="gh_cb60c5bbf301" :path="'pages/roomIndex?roomId='+vid" style="position: absolute;width: 100%;height: 100%;opacity: 0;left: 0;right: 0;top: 0;bottom: 0;" > <script type="text/wxtag-template"> <style>.btn { padding: 12px;position: absolute;top: 0;left: 0;right: 0;bottom: 0;opacity: 0.5;}</style> <button class="btn">打开小程序</button> </div> </script> </wx-open-launch-weapp>
但这种方式基本上样式没法调 浏览器 开发工具和真机都不一致
所以我是直接透明度0 绝对定位盖住我们想要盖住的区域就行了
发表评论 取消回复