vue3-camera is a simple Vue 3 component designed to integrate webcam functionality into Vue applications. Easily capture images from the user's webcam with minimal configuration.
- Easy Integration: Seamlessly integrate webcam functionality into your Vue 3 projects.
- Capture Images: Capture images from the user's webcam.
- Customizable: Customize the component to fit your application's styling and requirements.
npm install vue3-camera
-
Import the
Vue3Camera
component into your Vue file.<script setup lang="ts"> import Camera from "vue3-camera" </script>
-
Use the
Vue3Camera
component in your template.<template> <Camera @on-snapshot="onSnapshot" facing-mode="environment" :grid-line="true" /> </template>
-
Handle the event for image capture in your methods.
const onSnapshot = (base64: string) => { console.log(base64) }
- facing-mode: "environment" | "user" (default: "environment").
- grid-line: boolean.
- on-snapshot: Triggered when an image is captured. Returns the captured image data.
<Camera @on-snapshot="onSnapshot"/>
This project is licensed under the MIT License - see the LICENSE.md file for details.
Contributions are welcome! Please open an issue or submit a pull request.