LtModal.vue 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. <!----通用弹窗组件---->
  2. <template>
  3. <div class="modal-container">
  4. <div class="cover"></div>
  5. <div class="modal-box">
  6. <div class="modal-title">
  7. <a class="close" @click="close()">×</a>
  8. </div>
  9. <div class="modal-body">
  10. <slot></slot>
  11. </div>
  12. <div class="modal-footer">
  13. <a class="confirm btn" @click="confirm()">确定</a>
  14. <a class="cancel btn" @click="close()">取消</a>
  15. </div>
  16. </div>
  17. </div>
  18. </template>
  19. <script>
  20. export default {
  21. name:'lt-modal',
  22. data:function(){
  23. return{
  24. }
  25. },
  26. methods:{
  27. close(){
  28. this.$emit("close");
  29. },
  30. confirm(){
  31. this.$emit("confirm");
  32. }
  33. }
  34. }
  35. </script>
  36. <style lang="less" scoped>
  37. .modal-container{
  38. position: fixed;
  39. top:0;
  40. left: 0;
  41. width: 100%;
  42. height: 100%;
  43. z-index: 21;
  44. .cover{
  45. background: #000;
  46. opacity: .2;
  47. width: 100%;
  48. height: 100%;
  49. }
  50. .modal-box{
  51. width: 860px;
  52. height: 564px;
  53. background: #fff;
  54. position: absolute;
  55. left: 50%;
  56. top:50%;
  57. margin-left: -430px;
  58. margin-top: -282px;
  59. .modal-title{
  60. height: 40px;
  61. background: #E3EAF4;
  62. .close{
  63. float: right;
  64. margin:3px 13px 0 0;
  65. font-size: 22px;
  66. color: #979797;
  67. cursor: pointer;
  68. }
  69. }
  70. .btn{
  71. display: inline-block;
  72. width: 70px;
  73. height: 34px;
  74. line-height: 34px;
  75. background: #48C5D7;
  76. border-radius: 4px;
  77. color: #fff;
  78. text-align: center;
  79. cursor: pointer;
  80. }
  81. .cancel{
  82. background: #fff;
  83. color: #48C5D7;
  84. border:1px #48C5D7 solid;
  85. margin-left: 40px;
  86. }
  87. .modal-body{
  88. padding:20px 22px ;
  89. }
  90. .modal-footer{
  91. /*position: absolute;
  92. bottom: 32px;*/
  93. width: 100%;
  94. text-align: center;
  95. }
  96. }
  97. }
  98. </style>