Alert.vue 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <template>
  2. <div class="default-alert">
  3. <div class="top">{{AlertTitle}}
  4. <i class="el-icon-close" @click="closeAlert()"></i>
  5. </div>
  6. <div class="content">
  7. <slot>
  8. </slot>
  9. </div>
  10. </div>
  11. </template>
  12. <script>
  13. export default {
  14. props: {
  15. AlertTitle: {
  16. type: String,
  17. default: '新增公司地址'
  18. }
  19. },
  20. methods: {
  21. closeAlert() {
  22. this.$emit('closeAlert')
  23. }
  24. }
  25. }
  26. </script>
  27. <style lang="scss" scoped>
  28. .default-alert {
  29. width: 618px;
  30. border-radius: 5px;
  31. box-shadow: 0 5px 5px #bcd2ff;
  32. overflow: hidden;
  33. position: fixed;
  34. left: 50%;
  35. top: 10%;
  36. transform: translate3d(-50%, 0%, 0);
  37. z-index: 999;
  38. .top {
  39. color: #fff;
  40. font-size: 14px;
  41. line-height: 30px;
  42. position: relative;
  43. text-indent: 12px;
  44. margin-bottom: 0px;
  45. background: #6093f6;
  46. i {
  47. position: absolute;
  48. color: #fff;
  49. font-size: 14px;
  50. right: 10px;
  51. top: 10px;
  52. cursor: pointer;
  53. }
  54. }
  55. .content {
  56. padding: 20px;
  57. background: #fff;
  58. }
  59. }
  60. </style>