<template>
  <div class="noScollLine">
    <!-- 预警信息弹框 -->
    <Home_YJ v-if="isShow.showYj" :show="isShow.showYj" :data="list.Info_YJ" />
  </div>
</template>

<script setup>
import emitter from "@/utils/eventBus.js";
import Home_YJ from "./components/home_yj.vue";
import { ref, onMounted, onUnmounted, reactive, getCurrentInstance } from "vue";
const { proxy } = getCurrentInstance();
const isShow = ref({
  showYj: false, //预警弹窗
});
const list = reactive({
  Info_YJ: [], //预警数据
});

onMounted(() => {
  // 展示预警
  emitter.on("showHomeYJ", (res) => {
    isShow.value.showYj = res ? true : false;
    if (res) list.Info_YJ = res;
  });
});
onUnmounted(() => {
  emitter.off("showHomeYJ");
});
</script>

<style lang="scss" scoped>
</style>