diff --git a/src/BootstrapBlazor.Shared/Locales/en.json b/src/BootstrapBlazor.Shared/Locales/en.json index 917651b6d5bb98a74f61537d1459ff707f26a772..48f5a262c1fd969814d838081b27c3b3418418f7 100644 --- a/src/BootstrapBlazor.Shared/Locales/en.json +++ b/src/BootstrapBlazor.Shared/Locales/en.json @@ -2207,6 +2207,8 @@ "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", + "TouchSwipingTitle": "Disable touch swiping", + "TouchSwipingIntro": "Set DisableTouchSwiping disable the swiping function on mobile", "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 03c5aebd42f5b66751161b7ba9683f0cfaf7a40a..6535b402074a9ff61fb505b57100359656527d8e 100644 --- a/src/BootstrapBlazor.Shared/Locales/zh.json +++ b/src/BootstrapBlazor.Shared/Locales/zh.json @@ -2212,6 +2212,8 @@ "CaptionIntro": "通过设置 CarouselItemCaption 属性,开启标题功能", "IntervalTitle": "切换间隔", "IntervalIntro": "通过设置 CarouselItemInterval 属性,可以单独设置幻灯片单独切换时间间隔,间隔默认值 5000 毫秒", + "TouchSwipingTitle": "禁用手势滑动", + "TouchSwipingIntro": "通过设置 DisableTouchSwiping 属性,禁用移动端手势滑动功能", "CaptionTemplateTitle": "标题模板", "CaptionTemplateIntro": "通过设置 CarouselItemCaptionTemplate 属性,自定义标题内容", "CaptionClassTitle": "标题样式", diff --git a/src/BootstrapBlazor.Shared/Samples/Carousels.razor b/src/BootstrapBlazor.Shared/Samples/Carousels.razor index fe683fa66ba64dcf4c66e156766de3ad34ce3662..046c050d424d4c24ec315e018d6fbe99fac56116 100644 --- a/src/BootstrapBlazor.Shared/Samples/Carousels.razor +++ b/src/BootstrapBlazor.Shared/Samples/Carousels.razor @@ -119,6 +119,20 @@ + + + + + + + + + + + + + + diff --git a/src/BootstrapBlazor/Components/Carousel/Carousel.razor b/src/BootstrapBlazor/Components/Carousel/Carousel.razor index 479d2ee072753bfe5f268c9671a45326040d1171..1fd66ab45c6a66eeea1620d879b1c287e80ecc44 100644 --- a/src/BootstrapBlazor/Components/Carousel/Carousel.razor +++ b/src/BootstrapBlazor/Components/Carousel/Carousel.razor @@ -1,7 +1,7 @@ @namespace BootstrapBlazor.Components @inherits IdComponentBase -
+
@ChildContent diff --git a/src/BootstrapBlazor/Components/Carousel/Carousel.razor.cs b/src/BootstrapBlazor/Components/Carousel/Carousel.razor.cs index edbee7de6afe5d58b3eff7116947b8c59184c8b7..d7026c7cd09f1537b201967c63722807d799ae5a 100644 --- a/src/BootstrapBlazor/Components/Carousel/Carousel.razor.cs +++ b/src/BootstrapBlazor/Components/Carousel/Carousel.razor.cs @@ -84,6 +84,14 @@ public partial class Carousel [Parameter] public bool ShowIndicators { get; set; } = true; + /// + /// 获得/设置 是否禁用移动端手势滑动 默认 false + /// + [Parameter] + public bool DisableTouchSwiping { get; set; } + + private string? DisableTouchSwipingString => DisableTouchSwiping ? "false" : null; + /// /// OnParametersSet 方法 ///