@svar-ui/vue-uploader
v2.6.0
Published
SVAR Vue Uploader library - file upload component with drag and drop support
Readme
SVAR Vue File Uploader
A Vue UI component for easy and intuitive file uploading, allowing users to drag and drop files or select them from their device. See the demos here.
How to Use
To use the widget, simply import the package and include the component in your Vue file:
<script setup>
import { ref } from "vue";
import { Uploader, UploaderList } from "@svar-ui/vue-uploader";
import "@svar-ui/vue-uploader/all.css";
const data = ref([]);
const uploadURL = "http://localhost:3000/data";
function handleUpload(ev) {
console.log(ev);
}
</script>
<template>
<UploaderList v-model:data="data" />
<Uploader :uploadURL="uploadURL" v-model:data="data" @upload="handleUpload" />
</template>How to Modify
Typically, you don't need to modify the code. However, if you wish to do so, follow these steps:
- Run
yarnto install dependencies. Note that this project is a monorepo usingyarnworkspaces, so npm will not work - Start the project in development mode with
yarn start
Run Tests
To run the test:
- Start the test examples with:
yarn start:tests - In a separate console, run the end-to-end tests with:
yarn test:cypress
