vue怎样调用微信的jssdk
1个回答
展开全部
试一下
var example1 = new Vue({
el: '#example-1',
data: {
},
ready: function() {
this.$http.get({
url: 'api/wx/tokenSignature',
data: {
url: mui.os.ios === true? window.url : (location.protocol + '//' + location.host + '/wx' + url)
},
success: function(json) {
wx.config({
debug: false,
appId: json.appId,
timestamp: parseInt(json.timestamp),
nonceStr: json.nonce,
signature: json.signature,
jsApiList: [
'onMenuShareAppMessage'
]
});
wx.ready(function () {
wx.onMenuShareAppMessage({
success: function () {
// 用户确认分享后执行的回调函数
},
cancel: function () {
// 用户取消分享后执行的回调函数
}
});
});
}
})
}
})
var example1 = new Vue({
el: '#example-1',
data: {
},
ready: function() {
this.$http.get({
url: 'api/wx/tokenSignature',
data: {
url: mui.os.ios === true? window.url : (location.protocol + '//' + location.host + '/wx' + url)
},
success: function(json) {
wx.config({
debug: false,
appId: json.appId,
timestamp: parseInt(json.timestamp),
nonceStr: json.nonce,
signature: json.signature,
jsApiList: [
'onMenuShareAppMessage'
]
});
wx.ready(function () {
wx.onMenuShareAppMessage({
success: function () {
// 用户确认分享后执行的回调函数
},
cancel: function () {
// 用户取消分享后执行的回调函数
}
});
});
}
})
}
})
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询