--- interface Props { page: number totalPage: number } const {page, totalPage} = Astro.props --- {totalPage > 1 && {page > 1 ? « 上一页 : « 上一页} {Array.from({length: totalPage}).map((_, index) => { if (page === index + 1) { return {index + 1} } return {index + 1} })} {page < totalPage ? 下一页 » : 下一页 »} }