Bootstap从v3.x版本迁移到v4.x版本时,发现dropdown组件的divider类不起作用了,下拉菜单中无法显示分割线。
查询官网手册后发现dropdown组件有如下变化:
- Switched from parent selectors to singular classes for all components, modifiers, etc.
- Simplified dropdown styles to no longer ship with upward or downward facing arrows attached to the dropdown menu.
- Dropdowns can be built with
<div>s or<ul>s now. - Rebuilt dropdown styles and markup to provide easy, built-in support for
<a>and<button>based dropdown items. - Renamed
.dividerto.dropdown-divider. - Dropdown items now require
.dropdown-item. - Dropdown toggles no longer require an explicit
<span class="caret"></span>; this is now provided automatically via CSS’s::afteron.dropdown-toggle.
其中可以发现,原有的"divider"类已经被重命名为"dropdown-divider"了。
用dropdown-divider替换掉divider之后,下拉菜单的分割线正常使用。
浙公网安备 33010602011771号