mirror of
https://github.com/element-plus/element-plus.git
synced 2026-03-13 07:51:17 +08:00
* feat(components): [dropdown-item] 支持通过 slot 设置图标 之前只能通过设置 `icon` prop 来设置菜单项的图标,如果要用其他图标库只能在 prop 中写 VNode 函数,大大降低可读性;要么就重复写 <ElIcon> 来进行统一布局。 现在引入了 `icon` slot,会自动将元素传入 ElIcon 的插槽中,这和 ElButton 的图标设计逻辑是一致的:既可以使用 prop 也可以使用 slot,但 slot 优先级较高。 close #22837 * test(components): [dropdown] added test for icon slot * docs(components): [dropdown] added description for `icon` slot * Update docs/en-US/component/dropdown.md Co-authored-by: btea <2356281422@qq.com> * style(docs): styling document * fix(components): [dropdown-item] incorrectly rendered el-icon * test(components): [dropdown-item] check incorrectly rendering --------- Co-authored-by: btea <2356281422@qq.com>