由于你覆盖了Dashboard的标题,你需要使用tags$title
来明确指定页面标题。
tags$title('This is my page')
对于shinydashboard
:
ui <- dashboardPage(title = 'This is my title', header, sidebar, body, skin='red')
虽然这是一个旧帖子,但在2022年现在有一个参数windowTitle
可以用于titlePanel
titlePanel(title, windowTitle = title)
因此,只需提供它,就像下面的示例中选项卡获取自己的文本字符串一样:
`titlePanel(
title=htmltools::div(
htmltools::img(
src="Transparent Logo No Slogan.png",style="width:50px; height:50px"),
"my application title"
),
windowTitle = "my tab title"
)`
最好的解决方案可能是以下内容:
header <- dashboardHeader(
title = HTML('<div> <img src="logo.png" height="60" width="120"/>')
)
tags$title
放在哪里呢?我正在使用 shinydashboard,当我把它放在dashboardHeader
中时,它显示“预期标签类型为 li”,但当我把它放在dashboardBody
中时,它不起作用。 - rankthefirst