ElemText.vue 647 B

12345678910111213141516171819202122232425262728293031323334353637
  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. fontFamily: this.data.fontFamily,
  26. fontSize: this.data.fontSize,
  27. color: this.data.color
  28. };
  29. }
  30. },
  31. data() {
  32. return {};
  33. },
  34. methods: {}
  35. };
  36. </script>