gpt4 book ai didi

javascript - 如何将 TradingView 小部件插入脚本标记链接 : https://www. Tradingview.com/widget/market-overview/中的 React JS 中

转载 作者:行者123 更新时间:2023-12-03 13:58:35 27 4
gpt4 key购买 nike

export default class extends Component {
render() {
return (
<div>
{
/***
* enter the code here
*/
}
</div>
)
}
}

最佳答案

export default  class Tabsshow extends React.PureComponent {
constructor(props) {
super(props);
this._ref = React.createRef();
}
componentDidMount() {
const script = document.createElement('script');
script.src = 'https://s3.tradingview.com/external-embedding/embed-widget-market-overview.js'
script.async = true;
script.innerHTML = /* JSON-ENCODED SETTINGS STRING FROM EMBED CODE */
this._ref.current.appendChild(script);
}
render() {
return(
<div class="tradingview-widget-container" ref={this._ref}>
<div class="tradingview-widget-container__widget"></div>

</div>
);
}

}

关于javascript - 如何将 TradingView 小部件插入脚本标记链接 : https://www. Tradingview.com/widget/market-overview/中的 React JS 中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53845011/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com