index.ts 2.13 KB
import { App } from 'vue';
import { use } from 'echarts/core';
import { CanvasRenderer } from 'echarts/renderers';
import { BarChart, LineChart, PieChart, RadarChart } from 'echarts/charts';
import { GridComponent, TooltipComponent, LegendComponent, DataZoomComponent, GraphicComponent } from 'echarts/components';
import AudioPlayer from '@/components/audio-player/index.vue';
import Chart from './chart/index.vue';
import Breadcrumb from './breadcrumb/index.vue';
import AvatarUpload from './avatar-upload/index.vue';
import InputUpload from './input-upload/index.vue';
import ImageUpload from './image-upload/index.vue';
import RouterButton from './router-button/index.vue';
import ExportButton from './export-button/index.vue';
import IconButton from './icon-button/index.vue';
import TagSelect from './tag-select/index.vue';
import UserSelect from './user-select/index.vue';
import FilterSearch from './filter/search.vue';
import FilterSearchItem from './filter/search-item.vue';
import FilterTable from './filter/table.vue';
import FilterTableColumn from './filter/table-column.vue';
import PageView from './page-view/index.vue';

// Manually introduce ECharts modules to reduce packing size

use([
  CanvasRenderer,
  BarChart,
  LineChart,
  PieChart,
  RadarChart,
  GridComponent,
  TooltipComponent,
  LegendComponent,
  DataZoomComponent,
  GraphicComponent,
]);

export default {
  install(Vue: App) {
    Vue.component('Chart', Chart);
    Vue.component('Breadcrumb', Breadcrumb);
    Vue.component('AvatarUpload', AvatarUpload);
    Vue.component('InputUpload', InputUpload);
    Vue.component('ImageUpload', ImageUpload);
    Vue.component('RouterButton', RouterButton);
    Vue.component('ExportButton', ExportButton);
    Vue.component('IconButton', IconButton);
    Vue.component('AudioPlayer', AudioPlayer);
    Vue.component('TagSelect', TagSelect);
    Vue.component('UserSelect', UserSelect);
    Vue.component('FilterSearch', FilterSearch);
    Vue.component('FilterSearchItem', FilterSearchItem);
    Vue.component('FilterTable', FilterTable);
    Vue.component('FilterTableColumn', FilterTableColumn);
    Vue.component('PageView', PageView);
  },
};