<template>
  <Transition :enter-active-class="proxy?.animate.rankingWindow.enter" :leave-active-class="proxy?.animate.rankingWindow.leave">
    <div class="mask" v-if="rankingState">
      <Ranking :imWindow="true" @getClose="restart"></Ranking>
    </div>
  </Transition>
</template>
<script setup lang="ts">
import Ranking from "@/views/ranking/index.vue"
const { proxy } = getCurrentInstance() as any;
const emit = defineEmits(['getClose']);

const data = reactive<any>({
  rankingState: false
});

const { rankingState } = toRefs(data);

//打开
const open = () => {
  rankingState.value = true;
};

//关闭
const close = () => {
  rankingState.value = false;
};

//重新其他
const restart = () => {
  emit('getClose', false);
};

//暴露给父组件用
defineExpose({
  rankingState,
  open,
  close
})
</script>
<style lang="scss" scoped>
.mask {
  position: fixed;
  height: 100vh;
  width: 100vw;
  top: 0;
  left: 0;
  background: radial-gradient(87% 87% at 9% -34%, #315f7e 0%, #0f1926 100%);
  z-index: 998;
}
</style>
