vue-js-xslx
v0.0.1
Published
![Vue.js version](https://img.shields.io/badge/dynamic/json.svg?label=vue.js&url=https%3A%2F%2Fraw.githubusercontent.com%2Fmagr0s%2Fvue-js-xlsx%2Fmaster%2Fpackage.json&query=dependencies.vue&colorB=blue&style=flat-square) ![xlsx version](https://img.shiel
Downloads
4
Readme
Vue js-xlsx
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