You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

56 lines
1.1 KiB

  1. <template>
  2. <action-menu
  3. :items="items"
  4. :text="$t('dataset.actions')"
  5. @create="$emit('create')"
  6. @upload="$emit('upload')"
  7. @download="$emit('download')"
  8. />
  9. </template>
  10. <script lang="ts">
  11. import Vue from 'vue'
  12. import { mdiPencil, mdiUpload, mdiDownload } from '@mdi/js'
  13. import ActionMenu from '~/components/utils/ActionMenu.vue'
  14. export default Vue.extend({
  15. components: {
  16. ActionMenu
  17. },
  18. props: {
  19. addOnly: {
  20. type: Boolean,
  21. default: false
  22. }
  23. },
  24. computed: {
  25. items() {
  26. const items = [
  27. {
  28. title: this.$t('labels.createLabel'),
  29. icon: mdiPencil,
  30. event: 'create'
  31. }
  32. ]
  33. if (this.addOnly) {
  34. return items
  35. } else {
  36. return items.concat([
  37. {
  38. title: this.$t('labels.importLabels'),
  39. icon: mdiUpload,
  40. event: 'upload'
  41. },
  42. {
  43. title: this.$t('labels.exportLabels'),
  44. icon: mdiDownload,
  45. event: 'download'
  46. }
  47. ])
  48. }
  49. }
  50. }
  51. })
  52. </script>