index.vue 656 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <template>
  2. <p
  3. class="break-words w-1/1 h-1/1"
  4. :class="props.vertical ? 'text-vertical' : ''"
  5. :style="{ fontFamily: props.fontFamily, fontSize: props.fontSize + 'px', color: props.fill }">
  6. {{ props.text }}
  7. </p>
  8. </template>
  9. <script setup lang="ts">
  10. const props = defineProps({
  11. fontFamily: {
  12. type: String,
  13. default: ''
  14. },
  15. fontSize: {
  16. type: Number,
  17. default: 15
  18. },
  19. text: {
  20. type: String,
  21. default: ''
  22. },
  23. fill: {
  24. type: String,
  25. default: ''
  26. },
  27. vertical: {
  28. type: Boolean,
  29. default: false
  30. }
  31. })
  32. </script>
  33. <style scoped>
  34. .text-vertical {
  35. writing-mode: tb;
  36. letter-spacing: 5px;
  37. }
  38. </style>