Skip to content

CommandBar-DEMO


vue
<div style="width: 100%;">
    <fv-CommandBar v-model="value" :options="options"></fv-CommandBar>
</div>

Compact Mode

vue
<div style="width: 100%;">
    <fv-CommandBar v-model="value" :options="options" :compact="true"></fv-CommandBar>
</div>

CommandBar-Toward Up


vue
<div style="width: 100%;">
    <fv-CommandBar :options="options" toward="up"></fv-CommandBar>
</div>

CommandBar-Right Space


vue
<div style="width: 100%;">
    <fv-CommandBar v-model="value" :options="options">
        <template v-slot:right-space>
            <span style="width: 40px; height: 40px; display: flex; justify-content: center; align-items: center;">
                <i class="ms-Icon ms-Icon--Error icon"></i>
            </span>
        </template>
    </fv-CommandBar>
</div>

CommandBar-Dark Theme


vue
<div style="width: 100%;">
    <fv-CommandBar :options="options" theme="dark"></fv-CommandBar>
</div>

CommandBar-Custom Background


vue
<div style="width: 100%;">
    <fv-CommandBar :options="options" theme="dark" background="rgba(0, 98, 158, 1)"></fv-CommandBar>
</div>

Properties


PropertyTypeRequiredDefaultDescription
modelValueobjectNo{}See the CommandBar modelValue option.
optionsarrayNo[]See the CommandBar options option.
towardstringNo'down'See the CommandBar toward option.
backgroundstringNo''See the CommandBar background option.
dropDownBackgroundstringNo''See the CommandBar dropDownBackground option.
compactbooleanNofalseSee the CommandBar compact option.
revealBorderColorbooleanNofalse
revealBackgroundColorbooleanNofalse
itemBorderRadiusnumberNo6See the CommandBar itemBorderRadius option.
themestringNo'global'Theme style. Supports global, light, dark, system, and custom.
disabledbooleanNofalseSee the CommandBar disabled option.
langstringNo"global"See the CommandBar lang option.

Events


EventArgumentsDescription
item-clickobjectSee the component item-click option.

Slots


  1. Right Space (right-space)
vue
<template v-slot:right-space>
  <i></i>
</template>
  1. Option Item (optionItem)
vue
<template v-slot:optionItem="{ item, valueTrigger }">
  <span>{{ valueTrigger(item.name) }}</span>
</template>
  1. List Item (listItem)
vue
<template v-slot:listItem="x">
    <i
        v-show="valueTrigger(x.item.icon) !== undefined"
        class="ms-Icon icon"
        :class="[
            `ms-Icon--${valueTrigger(x.item.icon)}`
        ]"
        :style="{
            color: valueTrigger(x.item.iconColor)
        }"
        style="font-size: 12px"
    ></i>
    <p class="name" style="font-size: 12px">
        {{ valueTrigger(x.item.name) }}
    </p>
</template>

Data


  1. options
javascript
options = [
  { name: "", icon: "", iconColor: "", foreground: "", background: "", type: "", func: {}, show: true, secondary: [], disabled: false }
];

//e.g.//

options: [
  {
    name: "Add",
    icon: "Add",
    iconColor: "rgba(0, 90, 158, 1)",
    func: this.customFunc,
    secondary: [
      {
        name: "Email Message",
        func: this.customFunc,
        icon: "Mail",
        iconColor: "rgba(0, 98, 158, 1)",
        disabled: true
      },
      { type: "divider" },
      {
        name: "Calendar event",
        func: this.customFunc,
        icon: "WebAppBuilderModule"
      }
    ]
  },
  { name: "Edit", func: this.customFunc, icon: "SingleColumnEdit", disabled: true },
  { type: "divider" },
  { name: "Share", func: this.customFunc, icon: "Share", foreground: "white", background: "rgba(0, 90, 158, 1)" },
  {
    type: "more",
    secondary: [
      { name: "Move to", func: this.customFunc, icon: "MoveToFolder" },
      { name: "Copy to", func: this.customFunc, icon: "Copy" },
      { name: "Rename", func: this.customFunc, icon: "Rename" }
    ]
  }
];

MIT Licensed