<script lang="ts" setup>
import { ref } from 'vue'
import List from './content/List.vue'
import Detail from './content/Detail.vue'

const type = ref('1')
const id = ref('')

function goDetail(value) {
  type.value = '2'
  id.value = value
}
</script>

<template>
  <div class="main">
    <List v-if="type === '1'" @go-detail="goDetail" />
    <Detail v-else :id="id" />
  </div>
</template>

<style lang="less" scoped>
.main {
  display: flex;
  flex-direction: row;
  box-sizing: border-box;
  width: 100%;
}
</style>
