一个对 Naive-UI 组件库的扩展,使 DataTable/Dropdown/Menu/Select/Tree 等组件支持插槽模板式的写法。An extension to Naive-UI component library, that enables slots and template style API for DataTable/Dropdown/Menu/Select/Tree.
MIT License
Naive-UI is a popular Vue 3 component library.
Due to the maintainability, the official team does not provide slots or template style APIs for DataTable
, Dropdown
, Menu
, Select
, Cascader
, Tree
, TreeSelect
etc..
Here are some related issues on GitHub:
This project is aimed to provide a solution for these issues above.
🚀 This has been added to Awesome Naive-UI.
v2.40.1
). You just need to add x-
before the original component name (example: <n-data-table>
→ <x-n-data-table>
).DataTable
: Scoped slots for columns, cells, expandable rows.DataTable
: Template style API for columns, summary.Dropdown
: Scoped slots for options, icons.Dropdown
: Template style API for options, option groups.Menu
: Template style API for options.Menu
: Scoped slots for options, icons.Select
: Template style API for options, option groups.Select
: Scoped slots for options, tags.Popselect
: Template style API for options, option groups.Popselect
: Scoped slots for options.Cascader
: Scoped slots for options.Tree
: Scoped slots for options, switcher icon.TreeSelect
: Scoped slots for options, tags, switcher icon.Button
: Display as a square when only icon.You can run the demo to view more details.
> pnpm install # install dependencies
> pnpm run build # build
> pnpm run demo # run demo, then visit http://localhost:8888/