wx-open-launch-app 开放标签自带一个内容空白的按钮,这个怎么可以设置相关样式?
代码:
<script>
//当前页URL
var pageurl = encodeURIComponent(location.href.split('#')[0]);
$.ajax({
url: "/jssdk/index?url=" + pageurl,
dataType: "json",
success: function(data) {
wx.config({
debug: true,
appId: data.appId,
timestamp: data.timestamp,
nonceStr: data.nonceStr,
signature: data.signature,
jsApiList: ['checkJsApi', 'onMenuShareTimeline', 'onMenuShareAppMessage',
'onMenuShareQQ', 'onMenuShareWeibo', 'previewImage',
'chooseImage', 'uploadImage', 'downloadImage',
'hideOptionMenu', 'hideMenuItems', 'hideAllNonBaseMenuItem'
],
openTagList: ['wx-open-launch-app']
});
}
});
</script>
</head>
<body>
<wx-open-launch-app
id="launch-btn"
appid="wx740ad8508cb83826"
extinfo="http://mdev.hzpgc.com/brand/detail/257"
>
<template>
<style>.btn { padding: 12px }</style>
<button class="btn">App内查看<button>
</template>
</wx-open-launch-app>
<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);
alert(e.detail.errMsg);
});
</script>
</body>
</html>