dotnetcore / BootstrapBlazor

A set of enterprise-class UI components based on Bootstrap and Blazor
https://www.blazor.zone
Apache License 2.0
2.22k stars 292 forks source link

doc(SortableList): 增加内部自定义渲染示例 #4302

Closed supperlitt closed 3 days ago

supperlitt commented 4 days ago

Is there an existing issue for this?

Is your feature request related to a problem? Please describe the problem.

1、创建两个SortableList 集合,内部渲染效果不一样。从A集合拖动到B集合。B集合的界面只是A集合的html节点变化,而需要B集合内部根据她自身的条件进行渲染。而不是完全一样的拖动。

Describe the solution you'd like

我希望B内部能够自定义渲染,因为本身他们之间差别很大,同时,默认的OnRemove,OnUpdate我很困扰,明明是一个删除一个添加,或者单纯的添加不删除,非要实现方法,有些多此一举。至少对我这种需求的使用来说i。

Additional context

No response

bb-auto[bot] commented 4 days ago

@supperlitt Thank you for reporting. We will give triage later.

ArgoZhang commented 4 days ago

@supperlitt 感谢提交 issue 我更新一下,弄个例子

ArgoZhang commented 3 days ago
<div class="col-12 col-sm-6">
    <SortableList Option="_option2" OnUpdate="OnUpdate1" OnRemove="OnRemove1">
        <div class="sl-list row g-2">
            @foreach (var item in Items1)
            {
                <FooSortableListItem @key="item" Value="item"></FooSortableListItem>
            }
        </div>
    </SortableList>
</div>
<div class="col-12 col-sm-6">
    <SortableList Option="_option2" OnUpdate="OnUpdate2" OnRemove="OnRemove2">
        <div class="sl-list row g-2">
            @foreach (var item in Items2)
            {
                <FooSortableListRightItem @key="item" Value="item"></FooSortableListRightItem>
            }
        </div>
    </SortableList>
</div>

示例已更新,至于 OnUpdate OnRemove 再认真看看理解一下。或者有不同的想法或者解决方案,在这里留言讨论