Error message:0:21:58.569 [Browser Thread: c606202b-d6f0-40c8-8783-6d87ffcaaef6] ERROR Perspective.Designer.Workspace - level: LEVEL_ERROR
message: "TypeError: Cannot read properties of undefined (reading 'createElement')"
line_number: 121
source: "http://localhost:8088/res/perspective/js/react-dom-18.2.0.js".
export interface EchartOneProps{
title: string
}
The code is as shown below:
export class EchartOne extends Component<ComponentProps,any>{
componentDidMount() {
this.initChart();
}
initChart = () => {
let myChart = echarts.init(document.getElementById("echartone"));
myChart.setOption({
tooltip: {},
xAxis: {
data: ["幼师资源","职场恩省","活动专区","纸币课堂"]
},
yAxis: {
},
series: [
{
name: "销量",
type: "bar",
data: [5000,20000,36000,10000]
}
]
});
}
render() {
const { props, emit } = this.props;
return (
<div {...emit()} title={props.title}>
<div id="echartone" title={props.title} style={{height: '300px'}}/>
</div>
);
}
}