v-title.vue 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <template>
  2. <view class="v-title">
  3. <view class="sign" v-if="sign" :style="{ background: signColor }"></view>
  4. <view class="title" :style="{ fontSize: size + 'rpx', color }">{{ text }}</view>
  5. <view class="more" v-if="isMore" @click="click">
  6. <text class="u-font-24 u-type-info">查看更多</text>
  7. <u-icon name="arrow-right" color="#999"></u-icon>
  8. </view>
  9. </view>
  10. </template>
  11. <script>
  12. export default {
  13. props: {
  14. text: {
  15. type: String,
  16. default: ''
  17. },
  18. sign: {
  19. type: Boolean,
  20. default: false
  21. },
  22. signColor: {
  23. type: String,
  24. default: '#e54a48'
  25. },
  26. size: {
  27. type: [String, Number],
  28. default: '30'
  29. },
  30. color: {
  31. type: String,
  32. default: '#333'
  33. },
  34. isMore: {
  35. type: Boolean,
  36. default: false
  37. }
  38. },
  39. data() {
  40. return {}
  41. },
  42. methods: {
  43. click() {
  44. this.$emit('more')
  45. }
  46. }
  47. }
  48. </script>
  49. <style lang="scss">
  50. @import '../style.components.scss';
  51. .v-title {
  52. @include vue-flex;
  53. .sign {
  54. width: 8rpx;
  55. height: 36rpx;
  56. margin-right: 16rpx;
  57. }
  58. .title {
  59. font-weight: bold;
  60. }
  61. .more {
  62. margin-left: auto;
  63. }
  64. }
  65. </style>