javascript - 加载 html / 脚本时 React Native Webview 不起作用
问题描述
我正在尝试使用“react-native-webview”库加载一个小部件。我相信我这样做是正确的,但小部件没有加载,我试图在 webview 本身上设置断点,它看起来像它的构建,有什么建议吗?
<WebView
source={{
html: `<!DOCTYPE html>
<html>
<body>
<script src="https://widgets.coingecko.com/coingecko-coin-price-marquee-widget.js"></script>
<coingecko-coin-price-marquee-widget coin-ids="bitcoin,ethereum,eos,ripple,litecoin" currency="usd" background-color="#ffffff" locale="en">
</coingecko-coin-price-marquee-widget>
</body>
</html>`,
}}
/>
解决方案
解决方案 - 我需要给 react-native-webview 一个宽度。
推荐阅读
- javascript - Javascript:如何在稀疏数组中插入孔或创建孔
- javascript - 如何使用 CSS 文件应用深色主题
- javascript - Cheerio:选择伪元素
- python - 多对多时间序列预测问题的 RNN 架构
- sql - SQL Server:选择 IF NOT EXISTS 比较 3 个相关表中的日期和时间
- javascript - 如果函数是对象,为什么我不能在 JS 的另一个函数中调用函数?
- laravel - Laravel Nova 度量值范围 - 日期范围
- python - 自定义列表类 __getitem__ 方法失败
- magento - 如何使用 Magento2 GraphQL 创建 Paypal 计费协议?
- swift - 在同一 ObservableObject 中使用 @published var 声明数组属性