Open chheng-dev opened 2 years ago
Install libs:
npm i read-excel-file npm i export-from-json
npm i read-excel-file
npm i export-from-json
In @types create arquive 'vue-excel-xlsx.d.ts' containing: declare module 'vue-excel-xlsx'
declare module 'vue-excel-xlsx'
In plugins create excelLib.ts containing:
import VueExcelXlsx from "vue-excel-xlsx" import Vue from 'vue' Vue.use(VueExcelXlsx)
In nuxt.config.js add: plugins: [ { src: "@/plugins/excelLib", mode: "client" }, ],
plugins: [ { src: "@/plugins/excelLib", mode: "client" }, ],
In package.json add: "type": "module",
"type": "module",
In tsconfig.json modify:
"target": "ES2018", "module": "ESNext",
to
"target": "esnext", "module": "commonjs",
Install libs:
npm i read-excel-file
npm i export-from-json
In @types create arquive 'vue-excel-xlsx.d.ts' containing:
declare module 'vue-excel-xlsx'
In plugins create excelLib.ts containing:
In nuxt.config.js add:
plugins: [ { src: "@/plugins/excelLib", mode: "client" }, ],
In package.json add:
"type": "module",
In tsconfig.json modify:
to