This commit is contained in:
parent
bb9e3a6448
commit
10e859bd28
|
|
@ -25,7 +25,6 @@ export function CarouselDemo() {
|
|||
const [current, setCurrent] = React.useState(0);
|
||||
const [count, setCount] = React.useState(0);
|
||||
const totalSlides = imageUrls.length;
|
||||
|
||||
React.useEffect(() => {
|
||||
if (!api) return;
|
||||
|
||||
|
|
@ -54,18 +53,18 @@ export function CarouselDemo() {
|
|||
{Array.from({ length: totalSlides }).map((_, index) => (
|
||||
<CarouselItem key={index} className="w-full h-full pl-0">
|
||||
<div className="p-0 w-full h-full">
|
||||
<CardContent className="p-0 w-full h-full m-0"> {/* 移除了 aspect-square */}
|
||||
|
||||
<CardContent className="flex aspect-square items-center justify-center p-0 w-full h-full m-0">
|
||||
<div
|
||||
className="w-full h-full"
|
||||
style={{
|
||||
backgroundImage: "url('/public/images/header.png')",
|
||||
backgroundSize: 'cover', // 改为 cover 以更好地适应容器
|
||||
backgroundPosition: 'center',
|
||||
backgroundRepeat: 'no-repeat',
|
||||
backgroundImage: "url('/public/images/header.png')",//背景图片可修改
|
||||
backgroundSize: '100% 100%',
|
||||
}}
|
||||
>
|
||||
</div>
|
||||
</CardContent>
|
||||
|
||||
</div>
|
||||
</CarouselItem>
|
||||
))}
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@ import {FireNewsList} from "./FireNewsList";
|
|||
export function FhywPage() {
|
||||
return(
|
||||
<div className="relative w-350 h-225 mx-auto overflow-hidden bg-sky-700">
|
||||
{/* 轮播背景图 */}
|
||||
<div className="absolute top-0 left-0 w-full h-180">
|
||||
{/* 轮播背景图 - 确保有明确尺寸 */}
|
||||
<div className="absolute top-0 left-0 w-full h-200">
|
||||
<CarouselDemo />
|
||||
</div>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue