<template>
    <z-paging ref="paging" v-model="list" :default-page-size="100" @query="handleQuery">
        <template #top>
            <mx-nav-bar :title="prevData.title"/>
        </template>
        <news-list class="p-30">
            <news-list-item v-for="item in list" :item="item"/>
        </news-list>
    </z-paging>
</template>

<script setup>
import {ref} from 'vue'
import {useTransfer} from "@/hooks/useTransfer";
import {getNewsList} from "@/api/webApi/career-news";
import NewsList from "@/pages/index/components/news-list.vue";
import NewsListItem from "@/pages/index/components/news-list-item.vue";

const paging = ref(null)
const list = ref([])
const {prevData} = useTransfer()

const handleQuery = (pageNum, pageSize) => {
    getNewsList({ids: prevData.value.ids, pageNum, pageSize})
        .then(res => paging.value.completeByTotal(res.rows, res.total))
        .catch(() => paging.value.complete(false))
}
</script>

<style lang="scss">

</style>
