Skip to content

cogor/vue-file-saver

Repository files navigation

vue-file-saver

size badge NPM Downloads NPM License

Simple alternative file-saver for Vue

Instalation

pnpm add vue-file-saver
npm i vue-file-saver

Usage

Add FileSaver component to your App.vue

<script setup>
   const { FileSaver } = useFileSaver()
</script>

<template>
    <!-- Your code... -->
    <FileSaver />
</template>

Use saveAs function in any component

<script setup>
    const { saveAs } = useFileSaver()
    
    function myDownloadFn() {
      saveAs(ObjectURL, "my-file.txt")
    }
</script>

...

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published