Element Plus 和 Mantine 组件对比调研

文档中为当前 content 系统中已经调用的 Element Plus 组件,分组按照 Element Plus 文档的组件分组。

配置

Element Plus 组件 Mantine 组件
ElConfigProvider MantineProvider,且更强大,可以作为全局样式入口

基础组件

Element Plus 组件 Mantine 组件
ElButton Button(参数不同,可以包装,但更强大)
ElIcon 官方搭配 tabler icon,支持使用第三方
ElCol Flex / Grid / Group 都可以替代
ElRow Flex / Grid / Group 都可以替代
ElScrollbar ScrollArea,可能没有 ElScrollbar 功能全,但是滚动相关基础 event 都包含
ElContainer AppShell 拆箱即用
ElHeader AppShell 拆箱即用
ElFooter AppShell 拆箱即用
ElMain AppShell 拆箱即用

Feedback

Element Plus 组件 Mantine 组件
ElAlert Alert(参数不同,可以包装)
ElDialog 对标 Modal(Mantine 的 Dialog 是 简版 的 Modal)
ElDrawer Drawer
ElTooltip Tooltip
ElPopconfirm 暂无实现, 需要自己封装
ElPopover HoverCard 或者 Popover 都可以实现
ElMessage Notification,堆栈类可以使用 notifications 扩展包
ElMessageBox modal 扩展包可以实现
v-loading 使用 Loader 的 LoadingOverlay 实现

Mantine 有独立安装的 modal 扩展包,可以实现更丰富的功能。

Navigation

Element Plus 组件 Mantine 组件
ElDropdown Menu
ElDropdownItem Menu.Item
ElDropdownMenu Menu
ElStep Stepper
ElSteps Stepper.Step
ElTabPane Tabs.Tab
ElTabs Tabs (功能比较简单,易用性不如 ElTabs)

Form

Element Plus 组件 Mantine 组件
ElAutocomplete Autocomplete,功能较弱
ElCascader 似乎国外都没有实现
ElCheckbox Checkbox
ElCheckboxGroup Checkbox.Group
ElDatePicker 暂无实现,需要 dates 扩展包
ElForm useForm
ElFormItem 暂无实现,很多基础控件比如 Input 自带了类似功能;有个比较类似的 Fieldset
ElInput 分拆了 TextInput 和 Textarea、PasswordInput 等组件
ElInputNumber NumberInput
ElRadio Radio
ElRadioButton 暂无实现,Radio 的样式系统可以轻松扩展
ElRadioGroup Radio.Group,SegmentedControl 也类似
ElSelect Combobox、MultiSelect、Select、TagsInput,拆了不同场景
ElOption 同 ElSelect
ElOptionGroup 同 ElSelect
ElSelectV2 暂无实现
ElSwitch Switch
ElUpload FileInput 比较基础,不包含数据传输层,只到文件选择;拖拽支持则需要 Dropzone 扩展包

Data

Element Plus 组件 Mantine 组件
ElCard 暂无对标实现,Mantine 的 Card 组件功能不同
ElCollapse Accordion (同名的 Collapse 只是 单个 的折叠展开)
ElCollapseItem Accordion.Item
ElPagination Pagination (Total 参数逻辑不同,但是很容易封装)
ElSkeleton Skeleton
ElTable Table(自带功能非常弱,官方没有高级表格的开发计划,推荐了一些社区方案
ElTableColumn Table
ElTag Pill
ElTimeline Timeline
ElTimelineItem Timeline.Item
ElTree Tree(用法大不同,更偏向 react 的用法)

其他

Element Plus 组件 Mantine 组件
ElDivider Divider
Blog