ElemText.vue 610 B

123456789101112131415161718192021222324252627282930313233343536
  1. <template>
  2. <div class="elem-text">
  3. <div class="text-body" :style="styles">
  4. <span
  5. v-for="(cont, index) in data.content"
  6. :key="index"
  7. :class="`cont-${cont.type}`"
  8. >{{ cont.content }}</span
  9. >
  10. </div>
  11. </div>
  12. </template>
  13. <script>
  14. export default {
  15. name: "elem-text",
  16. props: {
  17. data: {
  18. type: Object,
  19. },
  20. },
  21. computed: {
  22. styles() {
  23. return {
  24. fontWeight: this.data.fontWeight,
  25. fontSize: this.data.fontSize,
  26. color: this.data.color,
  27. };
  28. },
  29. },
  30. data() {
  31. return {};
  32. },
  33. methods: {},
  34. };
  35. </script>