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

<script setup>
import Main from "./Main/index.vue";
import AddOrEdite from "./AddOrEdite/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>