选择

Select2 提供了SingleSelectionMultipleSelection适配器作为单选和多选控件的默认实现,SelectionAdapter分别对应单选和多选控件。两个SingleSelectionMultipleSelection都继承自基础BaseSelection适配器。

可以通过为selectionAdapter配置选项分配自定义适配器来覆盖选择适配器。

select2/selection

装饰器

PlaceholderHidePlaceholder

AMD 模块:

select2/selection/placeholder select2/dropdown/hidePlaceholder

这些装饰器实现了 Select2 的占位符功能。

AllowClear

AMD 模块:

select2/selection/allowClear

此装饰器实现了可清除的选择allowClear选项所暴露的那样。

EventRelay

AMD 模块:

select2/selection/eventRelay

Select2 有一个内部事件系统,用来通知组件中各部分状态已发生改变,同时还有一个适配器可将其中一些事件传递到外部世界。

无噪 Logo
无噪文档
25 年 6 月翻译
文档源↗