A simple Vue 3 component for image file selection, drag-and-drop, and preview functionality.
Install the package using npm:
npm install vue-image-drop-form
Or using yarn:
yarn add vue-image-drop-form
Here is a simple example:
import VueImageDropForm from 'vue-image-drop-form'
// In your Vue component
<VueImageDropForm label="Upload Image" @change="handleImageChange" />
-
label
: The label for the file input.
-
change
: Emitted when a file is selected or dropped. The selectedFile
object is passed as an argument.
To run tests, execute the following command:
npm run test