2020-05-29 00:33:49 +08:00
|
|
|
|
@namespace AntDesign
|
2020-05-06 17:33:11 +08:00
|
|
|
|
@inherits AntDomComponentBase
|
|
|
|
|
|
2020-12-26 22:04:00 +08:00
|
|
|
|
<div class="@ClassMapper.Class">
|
|
|
|
|
<div class="@SlickSliderClassMapper.Class">
|
2021-01-21 17:20:10 +08:00
|
|
|
|
<div class="slick-list" @ref="Ref" style="@SlickListStyle">
|
2020-12-26 22:04:00 +08:00
|
|
|
|
<div class="slick-track" style="@TrackStyle">
|
2020-06-07 00:20:28 +08:00
|
|
|
|
@if (_slicks.Count > 0 && Effect == CarouselEffect.ScrollX)
|
2020-05-06 17:33:11 +08:00
|
|
|
|
{
|
2020-12-26 22:04:00 +08:00
|
|
|
|
<div data-index="-1" class="slick-slide slick-cloned" tabindex="-1" aria-hidden="true" style="@SlickClonedStyle">
|
2020-05-06 17:33:11 +08:00
|
|
|
|
<div>
|
|
|
|
|
<div tabindex="-1" style="width: 100%; display: inline-block;">
|
|
|
|
|
@_slicks.Last().ChildContent
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
}
|
2021-01-21 17:20:10 +08:00
|
|
|
|
<CascadingValue Value="this" IsFixed="@true">
|
2020-12-26 22:04:00 +08:00
|
|
|
|
@ChildContent
|
|
|
|
|
</CascadingValue>
|
2020-06-07 00:20:28 +08:00
|
|
|
|
@if (Effect == CarouselEffect.ScrollX)
|
2020-05-06 17:33:11 +08:00
|
|
|
|
{
|
|
|
|
|
for (int i = 0; i < _slicks.Count; i++)
|
|
|
|
|
{
|
|
|
|
|
int index = i;
|
2020-12-26 22:04:00 +08:00
|
|
|
|
<div data-index="@(i+_slicks.Count)" class="slick-slide slick-cloned" tabindex="-1" aria-hidden="true" style="@SlickClonedStyle">
|
2020-05-06 17:33:11 +08:00
|
|
|
|
<div>
|
|
|
|
|
<div tabindex="-1" style="width: 100%; display: inline-block;">
|
|
|
|
|
@_slicks[index].ChildContent
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<ul class="@($"slick-dots slick-dots-{DotPosition.ToString().ToLower()}")" style="display: block;">
|
|
|
|
|
@for (int i = 0; i < _slicks.Count; i++)
|
|
|
|
|
{
|
|
|
|
|
int index = i;
|
|
|
|
|
<li class="@(_slicks[index].Active?"slick-active":string.Empty)">
|
2020-12-26 22:04:00 +08:00
|
|
|
|
<button @onclick="(e)=>Activate(_slicks[index])">@(index + 1)</button>
|
2020-05-06 17:33:11 +08:00
|
|
|
|
</li>
|
|
|
|
|
}
|
|
|
|
|
</ul>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|