账号密码登录
微信安全登录
微信扫描二维码登录

登录后绑定QQ、微信即可实现信息互通

手机验证码登录
找回密码返回
邮箱找回 手机找回
注册账号返回
其他登录方式
分享
  • 收藏
    X
    webpack使用return import().then()这个函数,如果我想一起引jquery和echarts,如何改?
    24
    0
    import React from 'react';
    
    /**
     * 描述:Echarts 千层饼
     */
    
    class Foundation extends React.Component {
    
        constructor() {
            super();
        }
    
        _init() {
            // 参数设置
            var doc = document.getElementsByClassName('cs001')[0]
            //var optionECharts = this.props.defaultProps;
            return import(/* webpackChunkName: "echarts" */ 'echarts').then(echarts => {
                // 基于准备好的dom,初始化echarts实例
                var myChart = echarts.init(doc);
                // 指定图表的配置项和数据
                var app = {};
    
                app.title = '极坐标系下的堆叠柱状图';
    
                var option = {
                    angleAxis: {
                    },
                    radiusAxis: {
                        type: 'category',
                        data: ['周一', '周二', '周三', '周四'],
                        z: 10
                    },
                    polar: {
                    },
                    series: [{
                        type: 'bar',
                        data: [1, 2, 3, 4],
                        coordinateSystem: 'polar',
                        name: 'A',
                        stack: 'a'
                    }, {
                        type: 'bar',
                        data: [2, 4, 6, 8],
                        coordinateSystem: 'polar',
                        name: 'B',
                        stack: 'a'
                    }, {
                        type: 'bar',
                        data: [1, 2, 3, 4],
                        coordinateSystem: 'polar',
                        name: 'C',
                        stack: 'a'
                    }],
                    legend: {
                        show: true,
                        data: ['A', 'B', 'C']
                    }
                };
    
                // 使用刚指定的配置项和数据显示图表。
    
                if (option && typeof option === "object") {
                    myChart.setOption(option, true);
                }
    
    
            }).catch(error => 'An error occurred while loading the component');
        }
    
    
        componentDidMount() {
    
            this._init()
        }
    
    
    
        render() {
            return (
                <div className={'cs001'} style={{width: 800, height: 800}}>
    
                </div>
    
    
            )
        }
    }
    
    
    export default Foundation;
    
    0
    打赏
    收藏
    点击回答
        全部回答
    • 0
    • 火木耳 普通会员 1楼
      502 Bad Gateway

      502 Bad Gateway


      nginx
    更多回答
    扫一扫访问手机版
    • 回到顶部
    • 回到顶部