wx-jssdk
提取微信官方JSSDK,部分api接口使用Promise包装,后期根据使用添加.
根据微信JS-SDK说明文档在对应API后面加上Async
Installation
You can install it via npm.
$ npm i @defy/wx-jssdk -S
import Vue from 'vue';
import WxJssdk from '@defy/wx-jssdk'
Vue.prototype.$wx = WxJssdk;
Usage
// ...
mounted() {
this.$wx.configAsync({debug = false, appId:'', timestamp:'', nonceStr:'', signature:'', jsApiList = []}).then(res => {
console.log(res);
}).catch(e => {
console.log(e);
)
}
Trigger
// ...
methods: {
scanQRCode() {
this.$wx.scanQRCodeAsync().then(res=>{
console.log(res)
})
}
}