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

<script setup>

import Main from "./Main/index.vue";
import Details from "./Details/index.vue";
import { reactive, ref, watch } from "vue";
let showPage = ref('Main')
let editObj = reactive({
  editObj: {
    type: '60'
  }
}) // 60为酒后驾驶
const changePage = (val, obj) => {
  if (obj) {
    editObj.editObj = obj
  } else {
    editObj.editObj = null
  }
  showPage.value = val
}
watch(() => editObj, (newVal) => {
},
  { deep: true, immediate: true }
)
</script>
