<template>
  <CustomNavbar />
  <JbcSwiper :list="bannerList" />
  <view class="content"> home </view>
</template>

<script setup lang="ts">
import type { BannerItem } from '@/types/home'
import CustomNavbar from './components/CustomNavbar.vue'
import { ref } from 'vue'
import { getHomeBanner } from '@/services/home'
import { onLoad } from '@dcloudio/uni-app'

// 获取轮播图数据
const bannerList = ref<BannerItem[]>([])
const getBannerList = async () => {
  const res = await getHomeBanner()
  bannerList.value = res.result
  console.log('bannerList: ', bannerList.value)
}
onLoad(() => {
  getBannerList()
})
</script>

<style></style>
