Skip to content

Latest commit

 

History

History
39 lines (31 loc) · 913 Bytes

README.md

File metadata and controls

39 lines (31 loc) · 913 Bytes

Vue Membaca

Table of Contents

About

vue-membaca is a Vue 3 component library to scan QR code and read the content. It uses zxingjs/browser to scan the QR code.

Getting Started

To use this library, you can install it via npm or yarn.

npm install vue-membaca

Usage

<script setup lang="ts">
const deviceId = ref<string>('')

onMounted(() => {
  const mediaDevices = await navigator.mediaDevices.getUserMedia({ video: true })
  deviceId.value = mediaDevices[0].id
})
</script>

<template>
  <QrCamera
    :device-id="deviceId"
    @result="handleResult"
    @error="handleError"
  />
</template>