繁体   English   中英

我想在我的项目中集成交易视图库,但是出现了这个错误

[英]i want to integrate trading view library in my project but this error comes

我收到此错误

TypeError:无法读取未定义的属性(读取“UDFCompatibleDatafeed”) 在此处输入图像描述

我删除了我的项目并克隆了他们的项目,然后我按照那些提到的步骤然后运行

我后来发现了问题

所以在我们的项目中,我错过了 index.html 中的两个脚本,然后它会在运行时出现此错误,因此请克隆项目,然后按照您的特定框架或库的提及步骤进行操作

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <script src="%PUBLIC_URL%/datafeeds/udf/dist/polyfills.js"></script>
        <script src="%PUBLIC_URL%/datafeeds/udf/dist/bundle.js"></script>
        <title>Charting Library React Demo</title>
    </head>
    <body>
        <noscript>
            You need to enable JavaScript to run this app.
        </noscript>
        <div id="root"></div>
        <!--
            This HTML file is a template.
            If you open it directly in the browser, you will see an empty page.
            You can add webfonts, meta tags, or analytics to this file.
            The build step will place the bundled scripts into the <body> tag.
            To begin the development, run `npm start`.
            To create a production bundle, use `npm run build`.
        -->
    </body>
</html>

在 index.html /public 文件夹中导入这两个脚本

 <script src="%PUBLIC_URL%/datafeeds/udf/dist/polyfills.js"></script>
 <script src="%PUBLIC_URL%/datafeeds/udf/dist/bundle.js"></script>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM