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

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

手机验证码登录
找回密码返回
邮箱找回 手机找回
注册账号返回
其他登录方式
分享
  • 收藏
    X
    dvajs里面ie10 class 不报错,但是用bizchart等图表报错
    30
    0

    为了解决The component appears to have a render method, but doesn't extend React.Component. dva issues 1717
    在 index.js里面添加

    import "@babel/polyfill";
    // import "core-js/fn/array/for-each";
    import dva from 'dva';
    import './index.css';
    
    Object.setPrototypeOf = require('setprototypeof');
    // 不加setprototypeof 报 issue 1717
    // 加了charts 报错

    加上这句bizcharts(recharts/echarts)都报错

    附上bizchars.js

    import React from 'react';
    import { Chart, Geom, Axis, Tooltip, Legend, Coord } from 'bizcharts';
    
    // 数据源
    const data = [
      { genre: 'Sports', sold: 275, income: 2300 },
      { genre: 'Strategy', sold: 115, income: 667 },
    ];
    
    // 定义度量
    const cols = {
      sold: { alias: '销售量' },
      genre: { alias: '游戏种类' }
    };
    
    // 渲染图表
    function Test(){
        return (
          <div>
            <Chart width={600} height={400} data={data} scale={cols}>
              <Axis name="genre" />
              <Axis name="sold" />
              <Legend position="top" dy={-20} />
              <Tooltip />
              <Geom type="interval" position="genre*sold" color="genre" />
            </Chart>
            <h3>2hahah</h3>
          </div>
        )
      }
    export default Test

    umijs 里面提到更新 babel https://github.com/umijs/umi/...,不明白怎么更新
    npm install babel@7.0.0-beta.48或者53都提示找不到包

    0
    打赏
    收藏
    点击回答
        全部回答
    • 0
    • じ☆ve谁 普通会员 1楼
      502 Bad Gateway

      502 Bad Gateway


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