<wx-open-launch-weappid="launch-btn"class="opentag"username="gh_6b4d28fdb9fe"path="/pages/index/index.html"@launch="handleLaunchFn"@error="handleErrorFn"><component:is="'script'"type="text/wxtag-template"style="display: block"><div style="margin: 16px"><buttonstyle="width: 295px;height: 42px;color: white;text-align: center;background: rgb(25, 137, 250);border: 1px solid rgb(25, 137, 250);border-radius: 21px;">注册</button></div></component></wx-open-launch-weapp>
const wxConfig = async () => {const params = {url: encodeURIComponent(location.href.split("#")[0]),};const { data } = await signature(params);wx.config({debug: false,appId: "wx83b985f77106165c", // 公众号idtimestamp: data.timestamp, // 后端提供nonceStr: data.noncestr, // 后端提供signature: data.signature, // 后端提供jsApiList: ["scanQRCode","updateAppMessageShareData","updateTimelineShareData",], // 必填,需要使用的JS接口列表,所有JS接口列表见附录2openTagList: ["wx-open-launch-weapp"],});wx.ready(function () {console.log("config ready");});wx.error(function (errMsg: string) {console.log("config error", errMsg);});};
wxConfig() 可以初始调用,也可以在接口后面调用
Vue.config.ignoredElements = ["wx-open-launch-app","wx-open-launch-weapp",];
