TextColorButton.vue 847 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <template>
  2. <Button class="text-color-btn">
  3. <slot></slot>
  4. <div class="text-color-block">
  5. <div class="text-color-block-content" :style="{ backgroundColor: color }"></div>
  6. </div>
  7. </Button>
  8. </template>
  9. <script lang="ts" setup>
  10. import Button from './Button.vue'
  11. defineProps<{
  12. color: string
  13. }>()
  14. </script>
  15. <style lang="scss" scoped>
  16. .text-color-btn {
  17. width: 100%;
  18. display: flex !important;
  19. flex-direction: column;
  20. justify-content: center;
  21. align-items: center;
  22. padding: 0;
  23. }
  24. .text-color-block {
  25. width: 17px;
  26. height: 4px;
  27. margin-top: 1px;
  28. background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAYAAACp8Z5+AAAAAXNSR0IArs4c6QAAACdJREFUGFdjfPbs2X8GBgYGSUlJEMXAiCHw//9/sIrnz59DVKALAADNxxVfaiODNQAAAABJRU5ErkJggg==);
  29. .text-color-block-content {
  30. width: 100%;
  31. height: 100%;
  32. }
  33. }
  34. </style>