pop.vue 938 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <template>
  2. <div
  3. class="pop-box"
  4. v-if="show"
  5. >
  6. <div
  7. class="pop-mask"
  8. v-if="mask"
  9. ></div>
  10. <div class="pop-content">
  11. <slot/>
  12. </div>
  13. </div>
  14. </template>
  15. <script>
  16. export default {
  17. name: "pop",
  18. props:{
  19. mask:{
  20. default: true
  21. },
  22. loading:{
  23. default: false
  24. },
  25. show:{
  26. default: false
  27. }
  28. },
  29. data(){
  30. return {
  31. }
  32. }
  33. }
  34. </script>
  35. <style scoped>
  36. .pop-box{
  37. position: fixed;
  38. left: 0;
  39. top: 0;
  40. width: 100vw;
  41. height: 100vh;
  42. z-index: 50;
  43. display: flex;
  44. justify-content: center;
  45. align-items: center;
  46. overflow: hidden;
  47. }
  48. .pop-mask{
  49. background-color: #000;
  50. opacity: 0.3;
  51. position: absolute;
  52. left: 0;
  53. top: 0;
  54. width: 100%;
  55. height: 100%;
  56. }
  57. .pop-content{
  58. width: 100%;
  59. height: 100%;
  60. position: relative;
  61. display: flex;
  62. justify-content: center;
  63. align-items: center;
  64. }
  65. </style>