vue3+ant+vben引用echarts

 在main.ts中引用

import * as echarts from 'echarts';
app.config.globalProperties.$echarts = echarts;

页面中使用

import echarts from '/@/plugins/echarts/index';

或者

import { getCurrentInstance } from 'vue';
const echarts = getCurrentInstance().appContext.config.globalProperties.$echarts;

 

posted @ 2021-11-16 10:18  张星星哦  阅读(759)  评论(0)    收藏  举报