HeaderSmallTips.vue 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <template>
  2. <div class="self_alert_tips" style="flex-shrink: 0;" v-if="visible">
  3. <div class="msg">
  4. <i class="hjx-dui iconfont"></i>
  5. <div class="tips_title">
  6. <template v-for="(item,index) in props.messageTipList" :key="item.title">
  7. {{item.title}}{{item.colon === false ? '' : ':'}} {{item.num}}{{ item.unit }}
  8. {{ index ==( props.messageTipList.length - 1) ? `` : `&nbsp; &nbsp; &nbsp;` }}
  9. </template>
  10. </div>
  11. </div>
  12. <i @click="visible = false" class="hjx-guanbi iconfont"></i>
  13. </div>
  14. </template>
  15. <script lang="ts" setup>
  16. import {ref} from 'vue'
  17. interface messageItem {
  18. title:string,
  19. unit:string,
  20. num:string,
  21. colon?:Boolean
  22. }
  23. const props = defineProps({
  24. messageTipList:{
  25. required:true,
  26. type:Array<messageItem>,
  27. default:()=>[]
  28. }
  29. })
  30. const visible = ref(true)
  31. </script>
  32. <style lang="scss" scoped>
  33. .hjx-dui{
  34. color: #FB9F34;
  35. }
  36. .hjx-guanbi{
  37. color: #F1DABF;
  38. &:hover{
  39. cursor: pointer;
  40. }
  41. }
  42. .self_alert_tips{
  43. border:solid rgba(251, 159, 52,0.1) 1px;
  44. border-radius: 4px;
  45. padding: 10px 12px;
  46. background-color: #fff6eb;
  47. font-size: 14px;
  48. display: flex;
  49. justify-content: space-between;
  50. align-items: center;
  51. .msg{
  52. display: flex;
  53. align-items: center;
  54. gap: 10px;
  55. .tips_title{
  56. color:#666666;
  57. }
  58. }
  59. }
  60. </style>