Initial commit
This commit is contained in:
22
app/plugins/highcharts.client.js
Normal file
22
app/plugins/highcharts.client.js
Normal file
@@ -0,0 +1,22 @@
|
||||
import Highcharts from "highcharts";
|
||||
import HighchartsVue from "highcharts-vue";
|
||||
|
||||
export default defineNuxtPlugin(async (nuxtApp) => {
|
||||
if (process.client) {
|
||||
const ExportingModule = await import("highcharts/modules/exporting");
|
||||
const ExportDataModule = await import("highcharts/modules/export-data");
|
||||
|
||||
const applyModule = (mod) => {
|
||||
if (typeof mod === "function") {
|
||||
mod(Highcharts);
|
||||
} else if (mod?.default && typeof mod.default === "function") {
|
||||
mod.default(Highcharts);
|
||||
}
|
||||
};
|
||||
|
||||
applyModule(ExportingModule);
|
||||
applyModule(ExportDataModule);
|
||||
}
|
||||
|
||||
nuxtApp.vueApp.use(HighchartsVue);
|
||||
});
|
||||
Reference in New Issue
Block a user