mask.vue 713 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <template>
  2. <transition name="popup-fade">
  3. <div v-show="show" class="bg nut-mask" ></div>
  4. </transition>
  5. </template>
  6. <script>
  7. export default {
  8. name: "nut-popup-mask",
  9. props: {
  10. show: { type: Boolean, default: true }
  11. },
  12. };
  13. </script>
  14. <style lang="scss" scoped>
  15. .popup-fade-enter-active {
  16. animation: 0.3s van-fade-in;
  17. }
  18. .popup-fade-leave-active {
  19. animation: 0.3s van-fade-out;
  20. }
  21. .bg {
  22. position: fixed;
  23. top: 0;
  24. left: 0;
  25. width: 100%;
  26. height: 100%;
  27. background-color: rgba(0, 0, 0, 0.7);
  28. z-index: 99;
  29. }
  30. @keyframes van-fade-in {
  31. from {
  32. opacity: 0;
  33. }
  34. to {
  35. opacity: 1;
  36. }
  37. }
  38. @keyframes van-fade-out {
  39. from {
  40. opacity: 1;
  41. }
  42. to {
  43. opacity: 0;
  44. }
  45. }
  46. </style>