naive-ui icon indicating copy to clipboard operation
naive-ui copied to clipboard

Drawer组件添加一个lazy属性,指定是否懒挂载

Open songjiachao opened this issue 10 months ago • 2 comments

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.

songjiachao avatar Apr 01 '24 09:04 songjiachao

类似 ant design 中的forceRender

https://ant-design.antgroup.com/components/drawer-cn

songjiachao avatar Apr 01 '24 10:04 songjiachao

Modal也需要这个懒挂载这个特性。

display-directive的组件建议都推广show:lazy参数。

ref: Tabs增加懒加载功能(lazy-load for tabs) · Issue #1374 · tusen-ai/naive-ui

NHZEX avatar Jun 17 '24 02:06 NHZEX