uniapp 中自带的二维码扫描的 API 是 uni.scanCode来识别,代码如下:
<template>
<view>
<button type="primary" @click="tel()">button</button>
</view>
</template>
<script>
export default {
data() {
return {
};
},
methods:{
tel:function(){
uni.scanCode({
success:function(res){
console.log(JSON.stringify(res.result));
}
});
}
}
}
</script>
网友回复