我正在使用Visual Studio Code在模板的帮助下开发Web组件。编写基本组件需要在打字稿文件中使用修饰符。 Visual Studio Code向我显示了一条错误消息,因为默认情况下,打字稿中不支持装饰器。在根目录中创建tsconfig.json并将其添加到"experimentalDecorators": true
中,可以消除警告。现在我想知道,模具编译器会使用此配置进行打字稿处理还是只是某些IDE专用工具的配置?
答案 0 :(得分:1)
是的,Stencil使用项目中的alphaOutput
进行TypeScript编译步骤,但是会覆盖library(shiny)
library(dragulaR)
library(shinyjs)
blocks <- c("Block A", "Block B", "Block C")
Blocks <- function(data, name)
{
div(style = "
text-align: center;
font-size: 12px;
background-color: #A9A9A9;
border-radius: 10px;
min-width: 80px;
color: black;",
drag = name,
div(class = "active-title", name),
id = gsub("[[:space:]]", "", name))
}
ui <- fluidPage(
sidebarPanel(width = 8,
fluidRow(style = "margin: 15px; height: 600px;",
fluidRow(
h3("Common Block Combos:"),
column(12,
selectInput("RECIPE", "",
c("A" = "A",
"B" = "B",
"None" = "none"),
selected = "none")
)
),
fluidRow(
h3("Drag and Drop:"),
column(6,
fluidRow(
column(3,
h5("Alpha Blocks:"),
div(id = "alphaBlocks", style = "min-height: 600px;",
lapply(blocks, Blocks, data = blocks))
),
column(6,
div(id = "alphaOutput",
style = "min-height: 300px;
margin-top: 0.5em; margin-left:-1em;
border-style: dotted;
border-color: #A9A9A9;
border-width: 2px;")
)
)
)
)
),
uiOutput("ui_alpha_dragular")
),
mainPanel(width = 2,
verbatimTextOutput("alpha")))
server <- function(input, output) {
# setting the initial value of each dragula drop area
output$alpha_dragular <- renderDragula({
dragula(c("alphaBlocks", "alphaOutput"))
})
# -------------------------------------------------------
# Change output area based on RECIPE dropdown
# -------------------------------------------------------
output$ui_alpha_dragular <- renderUI({
switch(
input$RECIPE,
A = dragulaOutput("alpha_dragular") %>%
onRender("function (el, x) {
$(\"#Block1\").appendTo(\"#alphaOutput\"); }"), # add parameters for A block
B = dragulaOutput("alpha_dragular"), # add parameters for B block (same as A)
dragulaOutput("alpha_dragular")
)
})
# -------------------------------------------------------
# Text output for testing
# -------------------------------------------------------
output$alpha <- renderPrint({
dragulaValue(input$alpha_dragular)
})
}
shinyApp(ui = ui, server = server)
的某些值。在撰写本文时,这些是:
tsconfig.json
请参见src/compiler/transpile/transpile-service.ts#L72-L89。
compilerOptions
是Stencil也使用的功能,因此应在tsconfig中启用。您可以查看tsconfig of the stencil-app-starter的推荐值。