apache / echarts

Apache ECharts is a powerful, interactive charting and data visualization library for browser
https://echarts.apache.org
Apache License 2.0
60.66k stars 19.61k forks source link

[Feature] 请问vue中的某个js文件里面想使用echarts,需要如何引入呢? #19026

Open Xulin-3 opened 1 year ago

Xulin-3 commented 1 year ago

What problem does this feature solve?

请问vue中的某个js文件里面想使用echarts,需要如何引入呢?

What does the proposed API look like?

请问vue中的某个js文件里面想使用echarts,需要如何引入呢?

echarts-bot[bot] commented 1 year ago

@Xulin-3 It seems you are not using English, I've helped translate the content automatically. To make your issue understood by more people and get helped, we'd like to suggest using English next time. 🤗

TRANSLATED
**TITLE** [Feature] May I ask how to import echarts in a js file in vue? **BODY** ### What problem does this feature solve? How do I want to use echarts in a js file in vue? ### What does the proposed API look like? How do I want to use echarts in a js file in vue?
MatthiasMert commented 1 year ago

vue-echarts?

Xulin-3 commented 1 year ago

sry, i am not actully sure about that. i write "import * as echarts from 'echarts'“ and "app.config.globalProperties.echarts = echarts" in the main.js. i can use echarts in any vue files, but it is not useful in js files.

Ovilia commented 1 year ago

I would suggest using vue-echarts. Otherwise, you should check your compiling configurations like webpack and etc.