1.0.6 • Published 4 years ago

vue-table-to-excel v1.0.6

Weekly downloads
8
License
MIT
Repository
-
Last release
4 years ago

vue-table-to-excel

Travis (.com) Codecov npm npm npm bundle size GitHub last commit NPM

Installation

$ npm install vue-table-to-excel

Usage

Single File Component Example:

Support for local configuration

+ component
<script>
import { jsontoexcel } from "vue-table-to-excel";
export default {
  data() {
    return {
      json: {
        dataSource: [
          { name: "Tom", phone: "+86 01012", email: "000@gmail.com" },
          { name: "Jack", phone: "+86 01012", email: "000@gmail.com" },
          { name: "Alice", phone: "+86 01012", email: "000@gmail.com" }
        ],
        head: ["name", "phone", "email"],
        fileName: "download.xlsx"
      }
    };
  },
  methods: {
    download() {
      const { data, head, fileName } = this.json;
      jsontoexcel.getXlsx(data, head, fileName);
    }
  }
};
</script>

API

getXlsx

src/index.js:16-44

A series of mixins is automatically generated for the url synchronization function

Parameters

  • options {{}} A map of $route.query keys to vm's property path
    • options.KeyOfOptions {string} Key of options is the value key on url query string, and its also the key in vm.$route
    • options.ValueOfOptions {string} Value of options is a path to find the actual value in vm

Returns {} A series of mixins

processEscapeStr2Value

src/index.js:54-54

process escape string to value with its data type

Parameters

  • str {string}

Returns (string | any | undefined | number)

processValue2EscapeStr

src/index.js:64-64

process value to escape string

Parameters

  • val {any}

Returns string

TODO

  • write demo

License

This project is licensed under the MIT license.

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago