Skip to content

Commit

Permalink
🐛 fix(Swiper): missing the InvokeVoidAsync public method (#2078)
Browse files Browse the repository at this point in the history
  • Loading branch information
capdiem committed Aug 5, 2024
1 parent e804cb7 commit eb32a2c
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/Masa.Blazor/Components/Swiper/MSwiper.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -208,4 +208,25 @@ await RunTaskInMicrosecondsAsync(
16,
_ctsForUpdateSlides.Token);
}

/// <summary>
/// Invoke a method of the Swiper instance.
/// </summary>
/// <param name="funcName">The name of the method</param>
/// <param name="args">The arguments of the method</param>
/// <example>
/// js: swiper.updateAutoHeight(speed);
/// <br />
/// c#: await MSwiperInstance.InvokeVoidAsync("updateAutoHeight", speed);
/// </example>
[MasaApiParameter]
public async Task InvokeVoidAsync(string funcName, params object[] args)
{
if (_swiperProxy is null)
{
return;
}

await _swiperProxy.InvokeVoidAsync(funcName, args);
}
}

0 comments on commit eb32a2c

Please sign in to comment.