docs: update menu developers notes

This commit is contained in:
afc163 2021-06-30 18:04:15 +08:00
parent 14521d32d9
commit 27642b23ba
2 changed files with 4 additions and 0 deletions

View File

@ -14,6 +14,8 @@ Navigation is an important part of any website, as a good navigation setup allow
More layouts with navigation: [Layout](/components/layout).
## Notes for developers
- Menu render as `ul` element. So it only support [`li` and `script-supporting` elements](https://html.spec.whatwg.org/multipage/grouping-content.html#the-ul-element) as children node。Your customize node should wrapped by `Menu.Item`.
- Menu need collect node structure. So it's children node should be `Menu.*` or HOC which used by it.

View File

@ -15,6 +15,8 @@ cover: https://gw.alipayobjects.com/zos/alicdn/3XZcjGpvK/Menu.svg
更多布局和导航的使用可以参考:[通用布局](/components/layout)。
## 开发者注意事项
- Menu 元素为 `ul`,因而仅支持 [`li` 以及 `script-supporting` 子元素](https://html.spec.whatwg.org/multipage/grouping-content.html#the-ul-element)。因而你的子节点元素应该都在 `Menu.Item` 内使用。
- Menu 需要计算节点结构,因而其子元素仅支持 `Menu.*` 以及对此进行封装的 HOC 组件。