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

<script setup>
import Main from "./Main/index";
import AddOrEdite from "./AddOrEdite/index";
import { reactive, ref, onMounted } from "vue";
import { useRoute, useRouter } from "vue-router";
const router = useRouter();
let showPage = ref("Main");
let editObj = reactive({
  editObj: null
});
onMounted(() => {

});
const changePage = (val, obj) => {
  if (obj) {
    editObj.editObj = obj;
  } else {
    editObj.editObj = null;
  }
  showPage.value = val;
};
</script>

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