TipModal.vue 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <template>
  2. <div class="tip_modal" v-if="tipFlag" @mousewheel="mousewheel">
  3. <div class="modal_content">
  4. <div class="img"><img src="../img/crossMark.png" @click="closeModal"/></div>
  5. <p>{{ tipText }}</p>
  6. <div class="button">
  7. <div class="current_button" @click="closeModal">确定</div>
  8. <div class="current_button" @click="closeModal" v-if="btnFlag">取消</div>
  9. </div>
  10. </div>
  11. </div>
  12. </template>
  13. <script>
  14. export default {
  15. props: {
  16. tipFlag: {
  17. type: Boolean,
  18. default: false,
  19. },
  20. tipText: {
  21. type: String,
  22. default: "删除成功!!!",
  23. },
  24. btnFlag: {
  25. type: Boolean,
  26. default: false
  27. }
  28. },
  29. methods: {
  30. mousewheel: function (e) {
  31. e.preventDefault();
  32. },
  33. closeModal: function() {
  34. this.$emit('close_tip_modal');
  35. }
  36. },
  37. };
  38. </script>
  39. <style scoped lang="less">
  40. .tip_modal {
  41. position: fixed;
  42. left: 0;
  43. top: 0;
  44. height: 100vh;
  45. width: 100vw;
  46. background-color: rgba(127, 127, 127, 0.7);
  47. display: flex;
  48. justify-content: center;
  49. align-items: center;
  50. .modal_content {
  51. width: 400px;
  52. height: 200px;
  53. background-color: #fff;
  54. transform: translateY(-150px);
  55. .img {
  56. background-color: #0056a0;
  57. display: flex;
  58. justify-content: flex-end;
  59. align-items: center;
  60. height: 40px;
  61. padding-right: 15px;
  62. img {
  63. width: 30px;
  64. height: 30px;
  65. &:hover {
  66. cursor: pointer;
  67. }
  68. }
  69. }
  70. p {
  71. font-size: 16px;
  72. margin-left: 50px;
  73. margin-top: 30px;
  74. }
  75. .button {
  76. margin-top: 50px;
  77. display: flex;
  78. justify-content: center;
  79. }
  80. }
  81. }
  82. </style>