You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

60 lines
2.2 KiB

  1. <template>
  2. <view v-if="type !== 'default'" class="cu-bar bg-white cu-title">
  3. <!-- 下划线标题(普通/变色) -->
  4. <view v-if="type === 'underline' || type === 'colorfulUnderline'" class="action border-title">
  5. <text :class="['text-' + color, blod ? 'text-blod' : '']" class="text-xl"><slot></slot></text>
  6. <text v-if="type === 'underline'" :class="'bg-' + color" style="width:2rem"></text>
  7. <text v-else-if="type === 'colorfulUnderline'" class="bg-gradual-blue" style="width:3rem"></text>
  8. </view>
  9. <!-- 扩散型下划线标题 -->
  10. <view v-else-if="type === 'blurUnderline'" class="action sub-title">
  11. <text :class="['text-' + color, blod ? 'text-blod' : '']" class="text-xl"><slot></slot></text>
  12. <text :class="'bg-' + color"></text>
  13. </view>
  14. <!-- 扩散型副标题 -->
  15. <view v-else-if="type === 'blurSubtitle'" class="action sub-title">
  16. <text :class="[' text-' + color, blod ? 'text-blod' : '']" class="text-xl"><slot></slot></text>
  17. <text :class="[' text-' + color]" class="text-ABC">
  18. <slot name="subtitle">{{ subtitle }}</slot>
  19. </text>
  20. </view>
  21. <!-- 后缀型副标题 -->
  22. <view v-else-if="type === 'nextSubtitle'" class="action title-style-3">
  23. <text :class="['text-' + color, blod ? 'text-blod' : '']" class="text-xl"><slot></slot></text>
  24. <text :class="'text-' + color" class="text-Abc self-end margin-left-sm light">
  25. <slot name="subtitle">{{ subtitle }}</slot>
  26. </text>
  27. </view>
  28. </view>
  29. <!-- 普通标题(圆点/长圆点) -->
  30. <view @click="$emit('click', $event)" v-else :class="[border ? 'solid-bottom' : '']" class="cu-bar bg-white cu-title">
  31. <view class="action" style="vertical-align: middle;">
  32. <text
  33. :class="[subColor ? 'text-' + subColor : '', long ? 'cuIcon-titles' : 'cuIcon-title']"
  34. class="margin-right-xs"
  35. ></text>
  36. <text :class="[blod ? 'text-blod' : '']" class="text-xl"><slot></slot></text>
  37. </view>
  38. </view>
  39. </template>
  40. <script>
  41. export default {
  42. name: 'l-title',
  43. props: {
  44. type: { default: 'default' },
  45. color: { default: 'black' },
  46. subColor: { default: 'blue' },
  47. long: {},
  48. subtitle: {},
  49. blod: {},
  50. border: {}
  51. }
  52. }
  53. </script>