r - 使用 Shinydashboard 无法正确显示 PDF
问题描述
我想将一个 pdf 文件嵌入到 Shinydashboard 中,当只有一个选项卡或者我只使用闪亮而不使用仪表板时,它会按预期显示。当我有两个选项卡时,虽然我可以单击屏幕上的按钮来调整其大小,但 PDF 将在第二个选项卡下显示为一个细条(参见屏幕截图)。有人可以帮助找出问题所在吗?这仅在 Chrome 中发生,但在 Edge 或 IE 中可以正常工作。提前致谢!
示例代码:
dashboardPage(
dashboardHeader(title = "Test"),
ui<-dashboardSidebar(
sidebarMenu(
menuItem("Model", tabName = "model"),
menuItem("Instruction", tabName = "inst"),
id = "tabm"
)
),
dashboardBody(
tabItems(
tabItem(tabName = "model",
h2("first tab content"),
tags$iframe(style="height:650px; width:100%; scrolling=yes",
src="shinyTexManual.pdf")
),
tabItem(
tabName = "inst",
fluidPage(
sliderInput("slider", "Slider", 1, 100, 50),
tags$iframe(style="height:650px; width:100%; scrolling=yes",
src="shinyTexManual.pdf")
)
)
)
)
)
server <- function(input, output) { }
解决方案
推荐阅读
- python - IndexError:使用线程列出超出范围的索引
- python - Sphinx:参考特殊方法
- javascript - 使用 socket.io 向目标客户端发送数据
- sql - 用逗号分割字符串并将其作为sql中的一行插入到表中
- jenkins - 用于在 android studio 项目中构建的流水线脚本
- angular - 为什么在订阅我的选择器 observable 时看不到来自 NGRX 的初始值?
- python-2.7 - 如何在 Python 2.7 中使用 SafeConfigParser 读取/写入/更新变音符号?
- java - 将一个函数从 java 转换为 kotlin android
- variables - 将表达式保存到变量
- oop - Rust 魔法方法之道