<template>
  <div class="common-layout">
    <el-container>
      <el-header><Navbar /></el-header>
      <el-main><router-view></router-view></el-main>
    </el-container>
  </div>
</template>

<script setup lang="ts">
import { onMounted, onUnmounted } from "vue";
import Navbar from "../components/Navbar.vue";
import useElecPriceStore from "../stores/useElecPriceStore";

const storeElecPrice = useElecPriceStore();

onMounted(async () => {
  await storeElecPrice.getElecDataFromBaja();
});

onUnmounted(() => {
  storeElecPrice.clearAllSubscriber();
});
</script>

<style scoped>
.el-header{
  padding: 0;
}
</style>
