From f65a1f760295a3d0f1583d464da1afa75df25316 Mon Sep 17 00:00:00 2001 From: zombieJ Date: Wed, 24 Apr 2019 11:52:28 +0800 Subject: [PATCH] Created API Naming rules (markdown) --- API-Naming-rules.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 API-Naming-rules.md diff --git a/API-Naming-rules.md b/API-Naming-rules.md new file mode 100644 index 0000000..9766bfd --- /dev/null +++ b/API-Naming-rules.md @@ -0,0 +1,28 @@ +Basically, antd naming requires **FULL NAME** instead of Abbreviation. + +## Props +* Initialize prop: `default` + `PropName` +* Force render: `forceRender` + * Force render sub component: `force` + `Sub Component Name` + `Render` +* Data Source: `dataSource` +* `children`: + * Mainly display content. To avoid additional prop name. + * Option list like `Select.Option` or `Tree.TreeNode`. + * Customize wrapped component can consider use `component` prop if `children` may have other usage in future. +* Display related naming: `show` + `PropName` +* Functional: `PropName` + `able` +* Disable: `disabled` + * sub component: `disabled` + `Sub Component Name` +* mainly icon: `icon` + * Multiple icons: `FunctionName` + `Icon` +* Trigger: `trigger` + * Sub function trigger: `Sub Function` + `Trigger` + * Trigger on the time point: `xxx` + `On` + `EventName` (e.g. `destroyOnClose`) + +## Event +* Trigger event: `on` + `EventName` +* Before trigger event: `before` + `EventName` +* After trigger event: `after` + `EventName` + +## Current listing api +ref: [#16048](https://github.com/ant-design/ant-design/issues/16048) \ No newline at end of file