<template>
	<view class="home">
		首页
		<listContent :main='domesticList'></listContent>
		<listContent></listContent>
		<listContent></listContent>
	</view>
</template>

<script setup>
	import { onMounted,toRefs,ref } from 'vue';
	import {Domestic,Variety,American} from '../../api/user.js';
	import listContent from '../../components/listContent.vue';
	onMounted(() => {
		getMain();
	})
	let domesticList = ref({});
	async function getMain() {
		console.log("走进来");
		let newList = [getList1(),getList2(),getList3()];
		console.log(newList,'列表')
		let [data1,data2,data3] = await Promise.allSettled(newList);
		domesticList.value = data1.value
		console.log(domesticList.value,'123')
		// Domestic().then(res => {
		// 	console.log("1212")
		// 	console.log(res,'res')
		// })
	}
	async function getList1() {
		return Domestic();
	}
	async function getList2() {
		return Variety();
	}
	async function getList3() {
		return American();
	}
</script>

<style>
</style>