JHCan333 2017-08-04 07:41 采纳率: 79.5%
浏览 997
已结题

react-redux项目出现问题,求解决

最近刚开始做react-redux项目,不太熟悉,出了很多错,求大手子指点。
项目文件的目录大概这样目录
我在show2.html中引入了show2.js文件,show2.js文件中包含了react组件,show2.html的情况是这样show2.html
在show2.js中引入了一个react组件,show2.js中是这样写的show2.js
所引入的charts是这样Charts,
其中,引入的start是这样

 import React, {Component} from 'react';

const echarts = require('echarts');

class Start extends Component {

    constructor(props) {
        super(props);
        this.setChartOption = this.setChartOption.bind(this);
        this.initChart = this.initChart.bind(this);
    }

    initChart() {
        $.ajax({
            url: this.props.url,
            dataType: 'json',
            cache: false,
            success: function (data) {
                let myChart = echarts.init(this.props.div);//初始化echarts
                //我们要定义一个setPieOption函数将data传入option里面
                console.log('22222');
                //设置options
                myChart.setOption(data);
                // myChart.setOption(this.props.chartStyle);
            }.bind(this),
            error: function () {
                alert('未获取到数据');
            }.bind(this)
        });

    }

    componentDidMount() {
        this.initChart();
    }

    componentDidUpdate() {
        this.initChart();
    }

    render() {
        return null;
    }


}

export default Start;

现在碰到的问题是这样!(数字是我测试用的,没有影响)error
我刚开始在show2.js中使用的是import引入所需组件,报的是这样的错error2
最近刚开始做这方面的东西,现在我该怎么办啊?运行不起来,我也不知道哪里出错了,求大手子前辈指点

  • 写回答

1条回答 默认 最新

  • zqbnqsdsmd 2018-06-20 15:15
    关注
    评论

报告相同问题?

悬赏问题

  • ¥15 thinkphp6配合social login单点登录问题
  • ¥15 HFSS 中的 H 场图与 MATLAB 中绘制的 B1 场 部分对应不上
  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch