簡體   English   中英

使用shinydashboard的框功能時擴展符號被截斷

[英]Expand symbol getting cutoff when using shinydashboard's box function

我有一個儀表板,里面有一個可折疊的盒子,效果很好,但出於某種原因,當盒子折疊時, +號被切斷(見下文)。 有誰知道如何解決這一問題?

在此處輸入圖片說明

在此處輸入圖片說明

## app.R ##
library(shiny)
library(shinydashboard)

ui <- dashboardPage(
  dashboardHeader(),
  dashboardSidebar(),
  dashboardBody(
    box(id = "tableBox", collapsible = TRUE, collapsed = F, width = "100%", height = "100%",
        "Taco Bell is an American-based chain of fast food restaurants originating in Irvine, California in 1962, by founder Glen Bell. Taco Bell is a 
        subsidiary of Yum! Brands, Inc. The restaurants serve a variety of Mexican-inspired foods, that include: tacos, burritos, quesadillas, nachos, 
        novelty and specialty items, along with a variety of value menu items. As of 2018, Taco Bell serves over two billion customers each year, at 
        7,072 restaurants, more than 93 percent of which are owned and operated by independent franchisees and licensees.")
  )
)

server <- function(input, output) { }

shinyApp(ui, server)

一個可能的解決方法是更改box()生成的 html 代碼,搜索 <div class="box-header"(第 8 行)並修改高度。

## app.R ##
library(shiny)
library(shinydashboard)

box_html <- 
'<div class="col-sm-100%">
  <div class="box" style="height: 100%">
    <div class="box-header" style="height: 40px; width: 50; pxtext-align: right;border: 0;"> 
      <div class="box-tools pull-right">
        <button class="btn btn-box-tool" data-widget="collapse">
          <i class="fa fa-minus" role="presentation" aria-label="minus icon" style="size:10px"></i>
        </button>
      </div>
    </div>
    <div class="box-body" id="tableBox">Taco Bell is an American-based chain of fast food restaurants originating in Irvine, California in 1962, by founder Glen Bell. Taco Bell is a 
        subsidiary of Yum! Brands, Inc. The restaurants serve a variety of Mexican-inspired foods, that include: tacos, burritos, quesadillas, nachos, 
        novelty and specialty items, along with a variety of value menu items. As of 2018, Taco Bell serves over two billion customers each year, at 
        7,072 restaurants, more than 93 percent of which are owned and operated by independent franchisees and licensees.</div>
  </div>
</div>'

ui <- dashboardPage(
    dashboardHeader(),
    dashboardSidebar(),
    dashboardBody(
        uiOutput('box')))

server <- function(input, output) { 
    
    output$box <- renderUI({
        tagList(
            HTML(box_html)
        )
        
    })
}

shinyApp(ui, server)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM