echarts
echarts copied to clipboard
[Feature] 不能将类型“EChartsType”分配给类型“ECharts”。 类型具有私有属性“_ssr”的单独声明。ts-plugin(2322)
What problem does this feature solve?
不想看到这个错误提示,一个大红线
What does the proposed API look like?
import { EChartsType } from 'echarts/core'; let myChart : EChartsType | null = null; myChart = echarts.init(echartRef.value) mychart下面飘着大红线非常讨厌,init返回的也是EChartsType类型的对象啊,为啥‘’不能将类型“EChartsType”分配给类型“ECharts”。 类型具有私有属性“_ssr”的单独声明。ts-plugin(2322)‘’ 这么讨厌的票着的大红?
@whr2349 Please provide a demo for the issue either with Official Editor, CodePen, CodeSandbox or JSFiddle.
按需引入 import { EChartsType } from 'echarts/core'; import * as echarts from "echarts/core"; 全部导入 import { EChartsType } from 'echarts'; import * as echarts from "echarts";
这样就不报错了