<template>
  <div>
    <Main v-if="showPage === 'Main'" @changePage="changePage"></Main>
    <Details v-else-if="showPage === 'Details'" @changePage="changePage" :editObj="editObj"></Details>
  </div>
</template>

<script setup>
import Main from "./Main/index.vue";
import Details from "./Details/index.vue";
import { reactive, ref } from "vue";

let showPage = ref('Main')
let editObj = ref({})
const changePage = (val, obj) => {
  if (obj) {
    editObj.value = obj
  } else {
    editObj.value = null
  }
  showPage.value = val

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