index.vue 1000 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <template>
  2. <Transition :enter-active-class="proxy?.animate.dialog.enter" :leave-active-class="proxy?.animate.dialog.leave">
  3. <div class="mask" v-if="rankingState">
  4. <Ranking :imWindow="true" @getClose="close"></Ranking>
  5. </div>
  6. </Transition>
  7. </template>
  8. <script setup lang="ts">
  9. const { proxy } = getCurrentInstance() as any;
  10. import Ranking from "@/views/ranking/index"
  11. const emit = defineEmits(['getClose']);
  12. //父值
  13. const props = defineProps({
  14. });
  15. const data = reactive<any>({
  16. rankingState: false
  17. });
  18. const { rankingState } = toRefs(data);
  19. //打开
  20. const open = () => {
  21. rankingState.value = true;
  22. };
  23. //关闭
  24. const close = () => {
  25. rankingState.value = false;
  26. emit('getClose', false);
  27. };
  28. //暴露给父组件用
  29. defineExpose({
  30. open,
  31. close
  32. })
  33. </script>
  34. <style lang="scss" scoped>
  35. .mask {
  36. position: fixed;
  37. height: 100vh;
  38. width: 100vw;
  39. top: 0;
  40. left: 0;
  41. background: radial-gradient(87% 87% at 9% -34%, #315f7e 0%, #0f1926 100%);
  42. z-index: 998;
  43. }
  44. </style>