tm-modal.vue 446 B

1234567891011121314151617181920212223242526272829303132
  1. <template>
  2. <view class="tm-modal" @click="$emit('click')">
  3. <slot></slot>
  4. </view>
  5. </template>
  6. <script>
  7. /**
  8. * modal弹出层
  9. * @click为点击元素的事件监听
  10. */
  11. export default {
  12. data() {
  13. return {
  14. };
  15. }
  16. }
  17. </script>
  18. <style lang="less">
  19. .tm-modal {
  20. overflow: hidden;
  21. position: absolute;
  22. top: 0;
  23. left: 0;
  24. width: 100%;
  25. height: 100%;
  26. z-index: 1000;
  27. background-color: rgba(18, 20, 26, 0.5);
  28. }
  29. </style>