mirror of
https://github.com/pure-admin/vue-pure-admin.git
synced 2025-11-09 13:53:38 +08:00
feat: add @pureadmin/utils
This commit is contained in:
@@ -1,19 +1,20 @@
|
||||
import { App } from "vue";
|
||||
import * as echarts from "echarts/core";
|
||||
|
||||
import { PieChart, BarChart, LineChart } from "echarts/charts";
|
||||
import { SVGRenderer } from "echarts/renderers";
|
||||
|
||||
import { PieChart, BarChart, LineChart } from "echarts/charts";
|
||||
import {
|
||||
GridComponent,
|
||||
TitleComponent,
|
||||
LegendComponent,
|
||||
GraphicComponent,
|
||||
ToolboxComponent,
|
||||
TooltipComponent,
|
||||
DataZoomComponent,
|
||||
VisualMapComponent
|
||||
} from "echarts/components";
|
||||
|
||||
const { use, registerTheme } = echarts;
|
||||
const { use } = echarts;
|
||||
// const { use, registerTheme } = echarts;
|
||||
|
||||
use([
|
||||
PieChart,
|
||||
@@ -23,14 +24,26 @@ use([
|
||||
GridComponent,
|
||||
TitleComponent,
|
||||
LegendComponent,
|
||||
GraphicComponent,
|
||||
ToolboxComponent,
|
||||
TooltipComponent,
|
||||
DataZoomComponent,
|
||||
VisualMapComponent
|
||||
]);
|
||||
|
||||
// 自定义主题
|
||||
import theme from "./theme.json";
|
||||
registerTheme("ovilia-green", theme);
|
||||
/**
|
||||
* @description 自定义主题
|
||||
* @see {@link https://echarts.apache.org/zh/download-theme.html}
|
||||
*/
|
||||
// import theme from "./theme.json";
|
||||
// registerTheme("ovilia-green", theme);
|
||||
|
||||
/**
|
||||
* @description 按需引入echarts
|
||||
* @see {@link https://echarts.apache.org/handbook/zh/basics/import#%E6%8C%89%E9%9C%80%E5%BC%95%E5%85%A5-echarts-%E5%9B%BE%E8%A1%A8%E5%92%8C%E7%BB%84%E4%BB%B6}
|
||||
*/
|
||||
export function useEcharts(app: App) {
|
||||
app.config.globalProperties.$echarts = echarts;
|
||||
}
|
||||
|
||||
export default echarts;
|
||||
|
||||
Reference in New Issue
Block a user