reactjs - 在反应中使用 iframe 显示本地 html 文件
问题描述
如何让 iframe 显示来自 React 组件的本地 html 文件。我的问题是,当我指向我的语言环境 html 文件时,反应路由器会接收请求并重定向到主页。所以 iframe 显示主页而不是静态 html 页面。
解决方案
try moving the HTML file to the Public folder, and then put "./yourfile.html"
as the source for the iframe. though i dont know if this is the best practice or not, but it solves my problem.
推荐阅读
- mongodb - MongoDB 分片集群中的文档计数错误
- google-app-engine - gcloud app deploy 无法灵活构建
- android - 将当前 ItemId 从 RecyclerAdapter 传递给不同的类
- linux - 最早的 Linux 内核,可以在现代硬件上运行
- excel - 矩阵中的索引匹配返回不存在的值
- javascript - 用字符串替换标签名称
- r - 如何按特定地点的受访者人数进行过滤?错误:FUN 中的错误(左、右):
- geometry - 凸约束和优化中的欧几里得距离
- php - 如何检测 pdf 链接并使用 php 替换为嵌入代码?
- css - PrimeNG 表,如何在表的右侧有一个冻结列?