From 4c37abf8b5074a16b44c0f5038385d7cab9b3d62 Mon Sep 17 00:00:00 2001 From: tangjinzhou <415800467@qq.com> Date: Tue, 8 May 2018 11:20:07 +0800 Subject: [PATCH] feat: add form doc --- ...advanced-search.md => advanced-search.vue} | 4 +- .../demo/{coordinated.md => coordinated.vue} | 4 +- ...ntrols.md => customized-form-controls.vue} | 4 +- ...mic-form-item.md => dynamic-form-item.vue} | 4 +- .../{dynamic-rule.md => dynamic-rule.vue} | 4 +- .../{form-in-modal.md => form-in-modal.vue} | 4 +- .../{global-state.md => global-state.vue} | 6 +- ...rizontal-login.md => horizontal-login.vue} | 4 +- components/form/demo/index.vue | 122 ++++++++---- .../form/demo/{layout.md => layout.vue} | 6 +- .../{normal-login.md => normal-login.vue} | 4 +- .../form/demo/{register.md => register.vue} | 4 +- components/form/demo/test.vue | 185 ------------------ ...-controls.md => time-related-controls.vue} | 4 +- .../{validate-other.md => validate-other.vue} | 6 +- ...validate-static.md => validate-static.vue} | 4 +- ...form-create.md => without-form-create.vue} | 4 +- components/form/index.en-US.md | 59 ++---- components/form/index.zh-CN.md | 60 ++---- site/components/demoBox.vue | 8 +- site/components/demoContainer.vue | 81 ++++++++ site/components/md.vue | 24 +-- site/demo.js | 1 + site/index.js | 2 + site/routes.js | 128 ++++++------ webpack.base.config.js | 3 + 26 files changed, 324 insertions(+), 415 deletions(-) rename components/form/demo/{advanced-search.md => advanced-search.vue} (99%) rename components/form/demo/{coordinated.md => coordinated.vue} (99%) rename components/form/demo/{customized-form-controls.md => customized-form-controls.vue} (99%) rename components/form/demo/{dynamic-form-item.md => dynamic-form-item.vue} (99%) rename components/form/demo/{dynamic-rule.md => dynamic-rule.vue} (99%) rename components/form/demo/{form-in-modal.md => form-in-modal.vue} (99%) rename components/form/demo/{global-state.md => global-state.vue} (98%) rename components/form/demo/{horizontal-login.md => horizontal-login.vue} (99%) rename components/form/demo/{layout.md => layout.vue} (98%) rename components/form/demo/{normal-login.md => normal-login.vue} (99%) rename components/form/demo/{register.md => register.vue} (99%) delete mode 100644 components/form/demo/test.vue rename components/form/demo/{time-related-controls.md => time-related-controls.vue} (99%) rename components/form/demo/{validate-other.md => validate-other.vue} (98%) rename components/form/demo/{validate-static.md => validate-static.vue} (99%) rename components/form/demo/{without-form-create.md => without-form-create.vue} (99%) create mode 100644 site/components/demoContainer.vue diff --git a/components/form/demo/advanced-search.md b/components/form/demo/advanced-search.vue similarity index 99% rename from components/form/demo/advanced-search.md rename to components/form/demo/advanced-search.vue index b8c5c43b2..8b4c30d92 100644 --- a/components/form/demo/advanced-search.md +++ b/components/form/demo/advanced-search.vue @@ -10,7 +10,7 @@ Three columns layout is often used for advanced searching of data table. Because the width of label is not fixed, you may need to adjust it by customizing its style. -```html + -``` + diff --git a/components/form/demo/customized-form-controls.md b/components/form/demo/customized-form-controls.vue similarity index 99% rename from components/form/demo/customized-form-controls.md rename to components/form/demo/customized-form-controls.vue index aec358d5c..55cad02db 100644 --- a/components/form/demo/customized-form-controls.md +++ b/components/form/demo/customized-form-controls.vue @@ -14,7 +14,7 @@ Customized or third-party form controls can be used in Form, too. Controls must > * It must be a class component. -```html + -``` + diff --git a/components/form/demo/dynamic-form-item.md b/components/form/demo/dynamic-form-item.vue similarity index 99% rename from components/form/demo/dynamic-form-item.md rename to components/form/demo/dynamic-form-item.vue index 91d6a5f40..dfcaa7027 100644 --- a/components/form/demo/dynamic-form-item.md +++ b/components/form/demo/dynamic-form-item.vue @@ -8,7 +8,7 @@ Add or remove form items dynamically. -```html + -``` + diff --git a/components/form/demo/form-in-modal.md b/components/form/demo/form-in-modal.vue similarity index 99% rename from components/form/demo/form-in-modal.md rename to components/form/demo/form-in-modal.vue index bade491cc..51173a81f 100644 --- a/components/form/demo/form-in-modal.md +++ b/components/form/demo/form-in-modal.vue @@ -8,7 +8,7 @@ When user visit a page with a list of items, and want to create a new item. The page can popup a form in Modal, then let user fill in the form to create an item. -```html + -``` + diff --git a/components/form/demo/global-state.md b/components/form/demo/global-state.vue similarity index 98% rename from components/form/demo/global-state.md rename to components/form/demo/global-state.vue index b3d5a1f47..85bb31a3c 100644 --- a/components/form/demo/global-state.md +++ b/components/form/demo/global-state.vue @@ -9,12 +9,12 @@ #### Store Form Data into Upper Component We can store form data into upper component. -**Note:** +**Note:** You must wrap field data with `Form.createFormField` in `mapPropsToFields`. The properties passed by the upper component must be declared in the props of `Form.create({ props: ...})`. -```html + -``` + diff --git a/components/form/demo/index.vue b/components/form/demo/index.vue index 040ee0a8b..e12c06e7b 100644 --- a/components/form/demo/index.vue +++ b/components/form/demo/index.vue @@ -1,25 +1,37 @@ + diff --git a/components/form/demo/layout.md b/components/form/demo/layout.vue similarity index 98% rename from components/form/demo/layout.md rename to components/form/demo/layout.vue index 174c860f4..80ce03c6b 100644 --- a/components/form/demo/layout.md +++ b/components/form/demo/layout.vue @@ -8,7 +8,7 @@ There are three layout for form: `horizontal`, `vertical`, `inline`. -```html + -``` + diff --git a/components/form/demo/normal-login.md b/components/form/demo/normal-login.vue similarity index 99% rename from components/form/demo/normal-login.md rename to components/form/demo/normal-login.vue index 039d9deee..4e80521c7 100644 --- a/components/form/demo/normal-login.md +++ b/components/form/demo/normal-login.vue @@ -8,7 +8,7 @@ Normal login form which can contain more elements. -```html + -``` + diff --git a/components/form/demo/test.vue b/components/form/demo/test.vue deleted file mode 100644 index 3dc8fdc54..000000000 --- a/components/form/demo/test.vue +++ /dev/null @@ -1,185 +0,0 @@ - - diff --git a/components/form/demo/time-related-controls.md b/components/form/demo/time-related-controls.vue similarity index 99% rename from components/form/demo/time-related-controls.md rename to components/form/demo/time-related-controls.vue index 712d2c1b8..35d7f612a 100644 --- a/components/form/demo/time-related-controls.md +++ b/components/form/demo/time-related-controls.vue @@ -8,7 +8,7 @@ the `value` of time-related components is `moment`. So, we need to pre-process those values. -```html + -``` + diff --git a/components/form/demo/validate-other.md b/components/form/demo/validate-other.vue similarity index 98% rename from components/form/demo/validate-other.md rename to components/form/demo/validate-other.vue index 1a71ea1dc..3b2babd97 100644 --- a/components/form/demo/validate-other.md +++ b/components/form/demo/validate-other.vue @@ -8,7 +8,7 @@ Demostration for validataion configuration for form controls which are not show in the above demos. -```html + -``` + diff --git a/components/form/demo/without-form-create.md b/components/form/demo/without-form-create.vue similarity index 99% rename from components/form/demo/without-form-create.md rename to components/form/demo/without-form-create.vue index 496719e18..226e177ff 100644 --- a/components/form/demo/without-form-create.md +++ b/components/form/demo/without-form-create.vue @@ -8,7 +8,7 @@ `Form.create` will collect and validate form data automatically. But if you don't need this feature or the default behaviour cannot satisfy your business, you can drop `Form.create` and handle form data manually. -```html +