warningBar.vue 904 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <template>
  2. <div
  3. class="warning-bar"
  4. :class="href&&'can-click'"
  5. @click="open"
  6. >
  7. <el-icon>
  8. <warning-filled />
  9. </el-icon>
  10. <span>
  11. {{ title }}
  12. </span>
  13. </div>
  14. </template>
  15. <script setup>
  16. import { WarningFilled } from '@element-plus/icons-vue'
  17. const prop = defineProps({
  18. title: {
  19. type: String,
  20. default: ''
  21. },
  22. href: {
  23. type: String,
  24. default: ''
  25. }
  26. })
  27. const open = () => {
  28. if (prop.href) {
  29. window.open(prop.href)
  30. }
  31. }
  32. </script>
  33. <style lang="scss" scoped>
  34. .warning-bar{
  35. background-color: #FFF5ED;
  36. font-size: 14px;
  37. padding: 6px 14px;
  38. display: flex;
  39. align-items: center;
  40. border-radius: 2px;
  41. .el-icon{
  42. font-size: 18px;
  43. color: #ED6A0C;
  44. }
  45. margin-bottom: 12px;
  46. span{
  47. line-height: 22px;
  48. color:#F67207;
  49. margin-left: 8px;
  50. }
  51. }
  52. .can-click{
  53. cursor: pointer;
  54. }
  55. </style>