uni-app調用手機攝像頭進行掃碼

<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>

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章