<template>
	<div class="form_wrap">
		<ATitle label="基本信息"></ATitle>

		<div class="components">
			<keep-alive>
				<component :is="currentComponent" />
			</keep-alive>
		</div>
	</div>
	<div class="form_footer">
		<a-space>
			<a-button type="primary">保存</a-button>
			<a-button @click="router.go(-1)" type="default">返回</a-button>
		</a-space>
	</div>
</template>

<script setup>
import { shallowRef, watch, ref } from "vue";
import ATitle from "@/components/ATitle.vue";
import contrast from "./contrast.vue";
import recruit from "./recruit.vue";
import bidding from "./bidding.vue";
import enquiry from "./enquiry.vue";
import { useRouter } from "vue-router";

const router = useRouter();

const pages = [contrast, recruit, bidding, enquiry, enquiry];
let currentComponent = shallowRef(contrast);
const type = ref("0");
watch(type, (n, o) => {
	currentComponent.value = pages[n];
});
</script>

<style lang="scss" scoped>
.components {
	padding-top: 20px;
}
</style>
