1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<template>
  <command :name="command">
    <icon :type="iconType" :title="text" />
    <span v-if="label">{{ label }}</span>
  </command>
</template>
 
<script>
import { Command } from 'vue-flowchart-editor'
import Icon from './Icon'
 
export default {
  name: 'EditorToolbarButton',
 
  props: ['command', 'icon', 'text', 'label'],
 
  computed: {
    iconType() {
      return `icon${this.icon || this.command}`
    },
  },
 
  components: {
    Command,
    Icon,
  },
}
</script>