0.0.1 • Published 5 years ago

vue-js-xslx v0.0.1

Weekly downloads
2
License
MIT
Repository
-
Last release
5 years ago

Vue js-xlsx Current version

Vue.js version xlsx version License

Vue.js plugin for SheetJs js-xlsx

Install

NPM

npm i vue-js-xlsx --save

Usage

mount with global

import VueXlsx from 'vue-js-xlsx'
Vue.use(VueXlsx)

mount with nuxt.js/ssr

// plugins/vue-js-xlsx.js
import VueXlsx from 'vue-js-xlsx'
Vue.use(VueXlsx)

// nuxt.config.js
{
  ...
  plugins: [{
    src: '~plugins/vue-js-xlsx.js',
    ssr: false
  }]
  ...
}

Once installed, the plugin add $xlsx to Vue.prototype to make him easily accessibles in every components.

Documentation

See SheetJs

Methods

/**
 * Generates different types of JS objects
 * @param {Blob} data
 * @param {Object} options
 * - parsingOpts {Object} See https://github.com/sheetjs/js-xlsx#parsing-options
 * - sheetIndex {Number} Select the sheet number you want to convert. Default: 0
 * - Others options. See https://github.com/sheetjs/js-xlsx#json
 * @returns {Array} array of objects

 */
const jsonData = this.$xlsx.toJson(data, options)

Development

Compiles and hot-reloads for development

npm run serve

Compiles and minifies for production

npm run build:lib

Lints and fixes files

npm run lint

Author

magr0s

License

MIT