SystemBar.vue 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <!--
  2. System bars
  3. -->
  4. <template>
  5. <v-system-bar
  6. height="50"
  7. :class="
  8. 'd-flex flex-row justify-center align-center text-center ' + classes
  9. "
  10. style="z-index: 1006;"
  11. @click="onClick !== undefined ? onClick() : null"
  12. >
  13. <!-- Forcing z-index to avoid this : https://github.com/vuetifyjs/nuxt-module/issues/205 -->
  14. <slot>
  15. <v-icon v-if="icon" small :icon="icon" />
  16. {{ text }}
  17. </slot>
  18. </v-system-bar>
  19. </template>
  20. <script setup lang="ts">
  21. const props = defineProps({
  22. text: {
  23. type: String,
  24. required: false,
  25. default: '',
  26. },
  27. icon: {
  28. type: String,
  29. required: false,
  30. default: undefined,
  31. },
  32. backgroundColor: {
  33. type: String,
  34. required: false,
  35. default: 'neutral-soft',
  36. },
  37. textColor: {
  38. type: String,
  39. required: false,
  40. default: 'on-neutral-soft',
  41. },
  42. onClick: {
  43. type: Function,
  44. required: false,
  45. default: undefined,
  46. },
  47. })
  48. // TODO: voir si possible d'utiliser les variables sass à la place?
  49. const classes = [
  50. 'bg-' + props.backgroundColor,
  51. 'text-' + props.textColor,
  52. props.onClick !== undefined ? 'clickable' : '',
  53. ].join(' ')
  54. </script>
  55. <style scoped lang="scss">
  56. .v-system-bar {
  57. font-size: 14px;
  58. }
  59. .v-icon {
  60. height: 20px;
  61. margin: 0 6px;
  62. }
  63. .clickable {
  64. cursor: pointer;
  65. }
  66. .clickable:hover {
  67. text-decoration: underline;
  68. }
  69. </style>