[vue] Introduce two different versions of echarts in the same vue project

Because I want to use the new functions of echarts5, but the project used version 4 before, if it is completely replaced with version 5, there will be compatibility problems, so I want to introduce two different versions of echarts in the same vue project

There is already a version of echarts in the default project

Install echarts5

npm install echarts5@npm:echarts@5

After installation, you can go to package.json to see
insert image description here


Introduce * where needed Note: The names introduced by the two versions cannot be the same

import * as Echarts5 from 'echarts5'

Guess you like

Origin blog.csdn.net/qq_44862029/article/details/126853990