HeadInfo.vue 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <template>
  2. <div class="head-info" :class="center && 'center'">
  3. <span>{{ title }}</span>
  4. <p>{{ content }} <a-icon :type="icon" style="font-size: 24px; color: #2b99ff" /></p>
  5. <em v-if="bordered" />
  6. </div>
  7. </template>
  8. <script lang="ts">
  9. import { defineComponent } from 'vue';
  10. export default defineComponent({
  11. name: 'HeadInfo',
  12. props: {
  13. title: {
  14. type: String,
  15. default: '',
  16. },
  17. content: {
  18. type: String,
  19. default: '',
  20. },
  21. bordered: {
  22. type: Boolean,
  23. default: false,
  24. },
  25. center: {
  26. type: Boolean,
  27. default: true,
  28. },
  29. icon: {
  30. type: String,
  31. default: false,
  32. },
  33. },
  34. });
  35. </script>
  36. <style lang="less" scoped>
  37. .head-info {
  38. position: relative;
  39. text-align: left;
  40. padding: 0 32px 0 0;
  41. min-width: 125px;
  42. &.center {
  43. text-align: center;
  44. padding: 0 32px;
  45. }
  46. span {
  47. color: rgba(0, 0, 0, 0.45);
  48. display: inline-block;
  49. font-size: 14px;
  50. line-height: 22px;
  51. margin-bottom: 4px;
  52. }
  53. p {
  54. color: rgba(0, 0, 0, 0.85);
  55. font-size: 24px;
  56. line-height: 32px;
  57. margin: 0;
  58. }
  59. em {
  60. background-color: #e8e8e8;
  61. position: absolute;
  62. height: 56px;
  63. width: 1px;
  64. top: 0;
  65. right: 0;
  66. }
  67. }
  68. </style>