1.安装依赖:npm install --save weixin-js-sdk
2.页面引用
包含扫码按钮的页面
<scanCode @sendCode=“sendCode” />
引入
import scanCode from ‘@/components/scanCodeEnterGoods.vue’
components: {
scanCode
}
sendCode (code) {
//alert(code) 扫码结果
//调用后台接口获取数据
this. a x i o s . g e t ( t h i s . axios.get(this.