From 6fb5c9eee1779f1e15fd2af4f891f8ebca9dabd1 Mon Sep 17 00:00:00 2001 From: capdiem Date: Mon, 5 Aug 2024 14:15:35 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix(Swiper):=20missing=20the=20I?= =?UTF-8?q?nvokeVoidAsync=20public=20method?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Components/Swiper/MSwiper.razor.cs | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/Masa.Blazor/Components/Swiper/MSwiper.razor.cs b/src/Masa.Blazor/Components/Swiper/MSwiper.razor.cs index f93ecbf14d..6eb4b7622f 100644 --- a/src/Masa.Blazor/Components/Swiper/MSwiper.razor.cs +++ b/src/Masa.Blazor/Components/Swiper/MSwiper.razor.cs @@ -208,4 +208,25 @@ await RunTaskInMicrosecondsAsync( 16, _ctsForUpdateSlides.Token); } + + /// + /// Invoke a method of the Swiper instance. + /// + /// The name of the method + /// The arguments of the method + /// + /// js: swiper.updateAutoHeight(speed); + ///
+ /// c#: await MSwiperInstance.InvokeVoidAsync("updateAutoHeight", speed); + ///
+ [MasaApiParameter] + public async Task InvokeVoidAsync(string funcName, params object[] args) + { + if (_swiperProxy is null) + { + return; + } + + await _swiperProxy.InvokeVoidAsync(funcName, args); + } }