123456789101112131415161718192021222324252627282930313233343536373839404142 |
- <template>
- <view class="home">
- 首页
- <listContent :main='domesticList'></listContent>
- <listContent :main='domesticList'></listContent>
- <listContent :main='domesticList'></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>
|