import Vue from 'vue'; import packageJson from '../package.json'; import BarEchart from '@/pages/BarEchart'; import LineEchart from '@/pages/LineEchart'; import PieEchart from '@/pages/PieEchart'; export interface InstallOptions { config: { [key: string]: any } } const components = [ BarEchart, LineEchart, PieEchart ]; function install(vue: typeof Vue, options: InstallOptions): void { const configuration = options.config; components.map((c: any) => { vue.component(c.NAME, c); vue.prototype[c.NAME] = configuration[c.NAME]; }); } export const version: string = packageJson.version; export { BarEchart, LineEchart, PieEchart, install }