text.vue 672 B

12345678910111213141516171819202122232425262728
  1. <template>
  2. <div class="text-center mb-4 last:mb-0" :style="styles" @click="click">
  3. <div v-if="options.html" v-html="options.html"></div>
  4. <template v-else>{{ options.text }}</template>
  5. </div>
  6. </template>
  7. <script>
  8. import Base from './base';
  9. import { mixinStyle } from './utils';
  10. export default {
  11. name: 'v-text',
  12. extends: Base,
  13. computed: {
  14. styles(){
  15. const { size, color, align, bold, style } = this.options;
  16. return mixinStyle({
  17. 'font-size': size && `${size}rem`,
  18. color,
  19. 'text-align': align,
  20. 'font-weight': bold ? 'bold' : undefined,
  21. }, style);
  22. }
  23. }
  24. }
  25. </script>
  26. <style lang="less" scoped>
  27. </style>