From d437766265e87577e506d792459923a4d0e61bc8 Mon Sep 17 00:00:00 2001 From: Argo-Lenovo Date: Mon, 12 Sep 2022 20:00:03 +0800 Subject: [PATCH 1/3] =?UTF-8?q?doc:=20=E6=9B=B4=E6=96=B0=E9=97=B4=E9=9A=94?= =?UTF-8?q?=E8=B5=84=E6=BA=90=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/BootstrapBlazor.Shared/Locales/en.json | 2 ++ src/BootstrapBlazor.Shared/Locales/zh.json | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/BootstrapBlazor.Shared/Locales/en.json b/src/BootstrapBlazor.Shared/Locales/en.json index 6a4274f79..917651b6d 100644 --- a/src/BootstrapBlazor.Shared/Locales/en.json +++ b/src/BootstrapBlazor.Shared/Locales/en.json @@ -2205,6 +2205,8 @@ "FadeIntro": "By setting the IsFade property, the picture switches with a fade-in and fade-out effect", "CaptionTitle": "Caption", "CaptionIntro": "Set CarouselItem parameter Caption for the content of caption", + "IntervalTitle": "Individual interval", + "IntervalIntro": "Set Interval to a CarouselItem to change the amount of time to delay between automatically cycling to the next item. the default value is 5000 ms", "CaptionTemplateTitle": "Caption Template", "CaptionTemplateIntro": "Set CarouselItemCaptionTemplate custom the caption of item", "CaptionClassTitle": "Caption Class", diff --git a/src/BootstrapBlazor.Shared/Locales/zh.json b/src/BootstrapBlazor.Shared/Locales/zh.json index 73eb67b7c..03c5aebd4 100644 --- a/src/BootstrapBlazor.Shared/Locales/zh.json +++ b/src/BootstrapBlazor.Shared/Locales/zh.json @@ -2210,6 +2210,8 @@ "FadeIntro": "通过设置 IsFade 属性,图片切换时采用淡入淡出效果", "CaptionTitle": "标题", "CaptionIntro": "通过设置 CarouselItemCaption 属性,开启标题功能", + "IntervalTitle": "切换间隔", + "IntervalIntro": "通过设置 CarouselItemInterval 属性,可以单独设置幻灯片单独切换时间间隔,间隔默认值 5000 毫秒", "CaptionTemplateTitle": "标题模板", "CaptionTemplateIntro": "通过设置 CarouselItemCaptionTemplate 属性,自定义标题内容", "CaptionClassTitle": "标题样式", -- Gitee From c006d00800d63e06b8c065450bd902733758330f Mon Sep 17 00:00:00 2001 From: Argo-Lenovo Date: Mon, 12 Sep 2022 20:00:11 +0800 Subject: [PATCH 2/3] =?UTF-8?q?doc:=20=E6=9B=B4=E6=96=B0=E7=A4=BA=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/BootstrapBlazor.Shared/Samples/Carousels.razor | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/BootstrapBlazor.Shared/Samples/Carousels.razor b/src/BootstrapBlazor.Shared/Samples/Carousels.razor index e2f8f1605..fe683fa66 100644 --- a/src/BootstrapBlazor.Shared/Samples/Carousels.razor +++ b/src/BootstrapBlazor.Shared/Samples/Carousels.razor @@ -35,6 +35,20 @@ + + + + + + + + + + + + + + -- Gitee From 568407391be2c44406066ac230203e6fb8bd2f26 Mon Sep 17 00:00:00 2001 From: Argo-Lenovo Date: Mon, 12 Sep 2022 20:00:27 +0800 Subject: [PATCH 3/3] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A0=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E9=97=B4=E9=9A=94=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Components/Carousel/Carousel.razor | 2 +- .../Components/Carousel/CarouselItem.cs | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/BootstrapBlazor/Components/Carousel/Carousel.razor b/src/BootstrapBlazor/Components/Carousel/Carousel.razor index 700417ecd..479d2ee07 100644 --- a/src/BootstrapBlazor/Components/Carousel/Carousel.razor +++ b/src/BootstrapBlazor/Components/Carousel/Carousel.razor @@ -19,7 +19,7 @@ @for (var index = 0; index < Items.Count; index++) { var item = Items[index]; -
+
@item.ChildContent @if (item.ShowCaption) { diff --git a/src/BootstrapBlazor/Components/Carousel/CarouselItem.cs b/src/BootstrapBlazor/Components/Carousel/CarouselItem.cs index f508cf9d8..5fd5b8779 100644 --- a/src/BootstrapBlazor/Components/Carousel/CarouselItem.cs +++ b/src/BootstrapBlazor/Components/Carousel/CarouselItem.cs @@ -33,9 +33,20 @@ public class CarouselItem : ComponentBase, IDisposable [Parameter] public RenderFragment? CaptionTemplate { get; set; } + /// + /// 获得/设置 Slider 切换时间间隔 默认 5000 + /// + [Parameter] + public int Interval { get; set; } = 5000; + [CascadingParameter] private Carousel? Carousel { get; set; } + /// + /// 获得 Interval 字符串 + /// + internal string? IntervalString => Interval == 5000 ? null : Interval.ToString(); + /// /// OnInitialized 方法 /// -- Gitee