message.vue 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <!-- 通知 -->
  2. <template>
  3. <v-app>
  4. <v-dialog
  5. v-model="dialog"
  6. :max-width="dialogWidth"
  7. :persistent="persistent || false"
  8. >
  9. <div class="white-bgc pa-5" style="border-radius: 2px; max-height: 600px; overflow-y: auto;">
  10. <div :class="['d-flex', {'flex-column': componentMap[name]}, 'align-center', {'mb-5': componentMap[name]}]">
  11. <!-- 前置图标 -->
  12. <span
  13. v-if="icon"
  14. :style="{color: iconColor? iconColor : color, fontSize: iconFontSize}"
  15. :class="[icon]"
  16. class="ml-2 mr-2"
  17. ></span>
  18. <svg-icon :name="name" :size="iconFontSize"></svg-icon>
  19. <!-- 文字 -->
  20. <div class="font-size-18" :style="{color:color}">{{message}}</div>
  21. </div>
  22. </div>
  23. <div class="text-center mt-3">
  24. <span style="color: white; font-size: 28px;" class="mdi mdi-close-circle-outline cursor-pointer" @click="dialog = false"></span>
  25. </div>
  26. </v-dialog>
  27. </v-app>
  28. </template>
  29. <script setup>
  30. import { ref } from 'vue'
  31. defineOptions({name: 'curtain-message'})
  32. defineProps({
  33. message: String, // 单条数据,也可以用list['']
  34. // list: Array, // 多条数据一起展示传list['', '']
  35. persistent: Boolean, // false: 点击遮罩层关闭dialog
  36. icon: String, // 前置图标
  37. dialogWidth: {
  38. type: [Number, String],
  39. default: '450'
  40. },
  41. iconFontSize: {
  42. type: String,
  43. default: '50px'
  44. },
  45. color: {
  46. type: String,
  47. default: 'darkorange'
  48. },
  49. iconColor: {
  50. type: String,
  51. default: ''
  52. },
  53. // 要展示的组件
  54. name: {
  55. type: String,
  56. default: ''
  57. }
  58. })
  59. const dialog = ref(true)
  60. </script>
  61. <style lang="scss" scoped>
  62. ::-webkit-scrollbar {
  63. width: 4px;
  64. height: 10px;
  65. // display: none;
  66. }
  67. ::-webkit-scrollbar-thumb, .temporaryAdd ::-webkit-scrollbar-thumb, .details_edit ::-webkit-scrollbar-thumb {
  68. // 滚动条-颜色
  69. background: #c3c3c379;
  70. }
  71. ::-webkit-scrollbar-track, .temporaryAdd ::-webkit-scrollbar-track, .details_edit ::-webkit-scrollbar-track {
  72. // 滚动条-底色
  73. background: #e5e5e58f;
  74. }
  75. </style>