naive-ui
naive-ui copied to clipboard
Drawer组件添加一个lazy属性,指定是否懒挂载
Clear and concise description of the problem
需要在Drawer show为true之前,获取Drawer实例DOM。但是现在Drawer是懒挂载的,需要show改为true后,才能生成实例DOM
Suggested solution
Expected API (期望的 API) Drawer组件添加一个lazy属性,默认为true,懒挂载。设为false时,初始化时立马挂载。
Alternative
No response
Additional context
No response
Validations
- [X] Read the Contributing Guidelines.
- [X] Read the docs.
- [X] Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
类似 ant design 中的forceRender
https://ant-design.antgroup.com/components/drawer-cn
Modal
也需要这个懒挂载这个特性。
有display-directive
的组件建议都推广show:lazy
参数。
ref: Tabs增加懒加载功能(lazy-load for tabs) · Issue #1374 · tusen-ai/naive-ui