@zeelyn/excel-preview-vue3

1.0.1 • Public • Published

Excel Preview

import { createApp } from "vue";
import App from "./App.vue";
import ExcelPreview from "@zeelyn/excel-preview-vue3";
const app = createApp(App);
import "@zeelyn/excel-preview-vue3/dist/style.css";
app.use(ExcelPreview);
app.mount("#app");
<template>
    <div class="wrap">
        <input type="file" @change="selectedFile" />
        <div class="container">
            <excel-preview ref="excelPreview" url="./test.xlsx"></excel-preview>
        </div>
    </div>
</template>
<script>
export default {
    name: "page",
    mounted() {},
    methods: {
        selectedFile(e) {
            var fileReader = new FileReader();
            var self = this;
            fileReader.onload = (e) => {
                self.$refs["excelPreview"].OpenExcel(fileReader.result);
            };
            fileReader.readAsArrayBuffer(e.target.files[0]);
        },
    },
};
</script>

/@zeelyn/excel-preview-vue3/

    Package Sidebar

    Install

    npm i @zeelyn/excel-preview-vue3

    Weekly Downloads

    202

    Version

    1.0.1

    License

    none

    Unpacked Size

    15.5 kB

    Total Files

    6

    Last publish

    Collaborators

    • kakous