Skip to contents

Element Plus's el-dropdown-item, for el_dropdown(items =).

Usage

el_dropdown_item(
  command,
  label = command,
  icon = NULL,
  disabled = NULL,
  divided = NULL
)

Arguments

command

The value input$<id> takes when the entry is clicked.

label

The entry's text. Defaults to command.

icon

The entry's icon, by name.

disabled

Whether the entry is disabled.

divided

Whether a divider is drawn above the entry.

Value

An entry, for el_dropdown(items =).

Binding

No argument follows v_bind(): an item is drawn by el_dropdown() from R.

Examples

el_dropdown(
  "dd",
  "Dropdown List",
  items = list(
    el_dropdown_item("apple", "Apple"),
    el_dropdown_item("pear", "Pear", disabled = TRUE),
    el_dropdown_item("plum", "Plum", divided = TRUE)
  )
)
#> <div id="dd" data-shiny-vue style="display: contents">
#>   <script type="text/x-template" data-shiny-vue-template><div id="dd_container" style="display: contents">
#>   <el-dropdown v-bind="$optional(&#39;dropdown&#39;)" :trigger="trigger" :hide-on-click="hideOnClick" :placement="placement" :disabled="disabled" :split-button="splitButton" @command="handleCommand" @click="svEmitClick">
#>     <span class="el-dropdown-link">
#>       Dropdown List
#>       <el-icon class="el-icon--right"><arrow-down /></el-icon>
#>     </span>
#>     <template v-slot:dropdown>
#>       <el-dropdown-menu>
#>         <el-dropdown-item :command="&quot;apple&quot;">Apple</el-dropdown-item>
#>         <el-dropdown-item :command="&quot;pear&quot;" :disabled="true">Pear</el-dropdown-item>
#>         <el-dropdown-item :command="&quot;plum&quot;" :divided="true">Plum</el-dropdown-item>
#>       </el-dropdown-menu>
#>     </template>
#>   </el-dropdown>
#> </div></script>
#>   <script type="application/json" data-shiny-vue-options>{"options":{"data":{"trigger":"hover","hideOnClick":true,"placement":"bottom-end","disabled":false,"splitButton":false,"count":0,"type":null,"size":null,"showTimeout":null,"hideTimeout":null,"tabindex":null,"appendTo":null,"buttonProps":null,"effect":null,"maxHeight":null,"persistent":null,"popperClass":null,"popperOptions":null,"popperStyle":null,"role":null,"showArrow":null,"teleported":null,"triggerKeys":null,"virtualRef":null,"virtualTriggering":null},"methods":{"svEmitClick":"function() { window.shinyVue.emit('dd', 'click', arguments); }","handleCommand":"function(cmd) { this.count++; window.Shiny && Shiny.setInputValue && Shiny.setInputValue('dd', cmd, {priority: 'event'}); window.Shiny && Shiny.setInputValue && Shiny.setInputValue('dd_count', this.count); }"}},"input":null,"rate":null,"type":null,"use":["shinyElement.plugin"],"optional":{"dropdown":{"type":"type","size":"size","show-timeout":"showTimeout","hide-timeout":"hideTimeout","tabindex":"tabindex","append-to":"appendTo","button-props":"buttonProps","effect":"effect","max-height":"maxHeight","persistent":"persistent","popper-class":"popperClass","popper-options":"popperOptions","popper-style":"popperStyle","role":"role","show-arrow":"showArrow","teleported":"teleported","trigger-keys":"triggerKeys","virtual-ref":{"field":"virtualRef","wrap":"elRef"},"virtual-triggering":"virtualTriggering"}},"evals":["options.methods.svEmitClick","options.methods.handleCommand"]}</script>
#> </div>