BaseTitle.vue 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <template>
  2. <div class="title-box" :style="{ backgroundImage: titleImg }">
  3. <span>{{ title }}</span>
  4. <img
  5. v-if="hasMore"
  6. class="more"
  7. :src="require('@/assets/imgs/maps/icon_more.png')"
  8. alt=""
  9. @click="$emit('openMore')"
  10. />
  11. </div>
  12. </template>
  13. <script>
  14. import TitleImg from '@/assets/imgs/panels/title_bg@2x.png'
  15. export default {
  16. props: {
  17. title: {
  18. type: String,
  19. default: '',
  20. },
  21. hasMore: {
  22. type: Boolean,
  23. default: false,
  24. },
  25. longTitle: {
  26. type: Boolean,
  27. default: false,
  28. },
  29. },
  30. computed: {
  31. titleImg() {
  32. return `url(${TitleImg})`
  33. },
  34. },
  35. }
  36. </script>
  37. <style lang="less" scoped>
  38. .title-box {
  39. width: 100%;
  40. height: 42px;
  41. background-repeat: no-repeat;
  42. background-size: 100% 100%;
  43. padding-left: 28px;
  44. display: flex;
  45. align-items: center;
  46. position: relative;
  47. span {
  48. margin-left: 5px;
  49. //
  50. font-size: 15px;
  51. color: #ffffff;
  52. letter-spacing: 1px;
  53. font-weight: 700;
  54. }
  55. .more {
  56. width: 28px;
  57. height: 28px;
  58. position: absolute;
  59. top: 0;
  60. right: 20px;
  61. cursor: pointer;
  62. }
  63. }
  64. </style>