DonNicoJs / vue-xlsx

XLSX manipulation made easy by Vue.js
https://vue-xlsx.netlify.com/
MIT License
40 stars 37 forks source link

Install in nuxtjs not working #25

Open dker92 opened 2 years ago

dker92 commented 2 years ago

Hi everyone, I am trying to install this package in nuxtjs but it seems to no be working My vue-xlsx.js plugin

import Vue from 'vue'
import { XlsxWorkbook, XlsxSheet, XlsxDownload } from 'vue-xlsx'

Vue.use(XlsxWorkbook)
Vue.use(XlsxSheet)
Vue.use(XlsxDownload)

nuxt.config

  plugins: [
    '@/plugins/element-ui',
    '@/plugins/axios',
    '@/plugins/bus',
    '@/plugins/reactive-search',
    '@/plugins/buefy',
    '@/plugins/vue-xlsx',
  ],
RahatChoudhary commented 1 year ago

Hello @dker92, Replace

Vue.use(XlsxWorkbook) Vue.use(XlsxSheet) Vue.use(XlsxDownload)

with

Vue.component('XlsxWorkbook', XlsxWorkbook) Vue.component('XlsxSheet', XlsxSheet) Vue.component('XlsxDownload', XlsxDownload)