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

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

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

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