Skip to content

http://ppchart.com/#/detail/xrJDKzwZQ 报错 #7

Closed

Description

@imingdev

Activity

  1. ppchart commented on Feb 15, 2022

    @ppchart
    Owner

    http://ppchart.com/#/detail/xrJDKzwZQ 报错 缺少 https://cdn.bootcss.com/PapaParse/4.1.2/papaparse.min.js 库

    ReferenceError: $ is not defined
    该案例引用了外部依赖,暂无法进行实时调试
    此类数据将在后续迭代后再支持

  2. Bclound commented on Feb 15, 2022

    @Bclound

    @ppchart 给你提供个技术支持,如果你有用new Function, 可以把$作为参数传进去,这样代码编辑那块就可以用jquery语法了。
    image

  3. imingdev commented on Feb 16, 2022

    @imingdev
    Author

    @ppchart 可以使用这种模式也可以,如果传入参数就用参数的,没有传入就走全局的

    const getOption = (src, obj) => {
        const name = 'sandboxName';
    
        try {
            new Function(name, `with(${name}){${src}}`)(obj);
        } catch (e) {
        }
    
        return obj?.option || null;
    };
    
    const option = getOption(optionCode,{
     $,
     option:{}
    })
    
  4. ppchart commented on Feb 16, 2022

    @ppchart
    Owner

    @ppchart 给你提供个技术支持,如果你有用new Function, 可以把$作为参数传进去,这样代码编辑那块就可以用jquery语法了。 image

    稳

  5. ppchart commented on Feb 16, 2022

    @ppchart
    Owner

    @ppchart 可以使用这种模式也可以,如果传入参数就用参数的,没有传入就走全局的

    const getOption = (src, obj) => {
        const name = 'sandboxName';
    
        try {
            new Function(name, `with(${name}){${src}}`)(obj);
        } catch (e) {
        }
    
        return obj?.option || null;
    };
    
    const option = getOption(optionCode,{
     $,
     option:{}
    })
    

    赞

  6. ppchart commented on Feb 16, 2022

    @ppchart
    Owner
    1. 目前支持了 $ 的使用,但外部脚本没有加载,所以代码仍不能运行成功,待增加外部依赖加载即可
    2. 还存在部分数据依赖的 Echarts 版本不对,因此待增加 Echarts 版本切换即可

    上述两个问题在本周内会支持&解决
    @imingdev

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions