tm-modal.vue 423 B

12345678910111213141516171819202122232425262728293031
  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. position: fixed;
  21. top: 0;
  22. left: 0;
  23. width: 100%;
  24. height: 100%;
  25. z-index: 1000;
  26. background-color: rgba(18, 20, 26, 0.5);
  27. }
  28. </style>