Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

执行 npm run watch:dev 调试报错 提示 echarts 对象找不到 #213

Open
xuyh1024 opened this issue Dec 24, 2022 · 0 comments
Open

Comments

@xuyh1024
Copy link

企业微信截图_16718644361870

分析原因是因为 以UMD引入 customed.js 时 找不到this 对象

    if (typeof define === 'function' && define.amd) {
        // AMD. Register as an anonymous module.
        define(['exports', 'echarts'], factory);
    } else if (typeof exports === 'object' && typeof exports.nodeName !== 'string') {
        // CommonJS
        factory(exports, require('echarts'));
    } else {
        // Browser globals
        factory({}, root.echarts);
    }

root.echarts 改为 Window.echarts 可解决

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant