From 7b7e3fed28821cb2002026fbbcb1c3a5ab1372dd Mon Sep 17 00:00:00 2001 From: jimczj Date: Thu, 6 Sep 2018 20:28:15 +0800 Subject: [PATCH] =?UTF-8?q?docs(form):=20=E8=A1=A5=E5=85=85=E6=96=87?= =?UTF-8?q?=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/markdown/form.md | 57 +++++++++++++++++++++++++++++++++++++++ docs/nav.config.yml | 2 ++ docs/view/Form/index.jsx | 10 +++++++ docs/view/Form/index.scss | 0 4 files changed, 69 insertions(+) create mode 100644 docs/markdown/form.md create mode 100644 docs/view/Form/index.jsx create mode 100644 docs/view/Form/index.scss diff --git a/docs/markdown/form.md b/docs/markdown/form.md new file mode 100644 index 000000000..b03452553 --- /dev/null +++ b/docs/markdown/form.md @@ -0,0 +1,57 @@ +# Form 表单组件 + +--- +将组件内的用户输入的值提交。当点击 表单中 formType 为 submit 的 button 组件时,会将表单组件中的 value 值进行提交,需要在表单组件中加上 name 来作为 key。 + +**目前该组件只对 AtInput 组件有效** + +## 使用指南 + +在 Taro 文件中引入组件 + +:::demo + +```js +import { AtForm, AtInput } from 'taro-ui' +``` + +::: + +## 一般用法 + +:::demo + +```html + + + + + +``` + +::: + +## 参数 + +| 参数 | 说明 | 类型 | 可选值 | 默认值 | +| ---------- | -------------------------------------- | ------- | ------------------------------------------------------------------- | -------- | +| style | 样式 | String or Object | - | - | +| reportSubmit | 是否返回 formId 用于发送模板消息 | Boolean | - | false | + + +## 事件 + +| 事件名称 | 说明 | 返回参数 | +|---------- |-------------- |---------- | +| onSubmit | 携带 form 中的数据触发 submit 事件 | event | +| onReset | 表单重置时会触发 reset 事件 | event | diff --git a/docs/nav.config.yml b/docs/nav.config.yml index 25d049585..5bb46f82d 100644 --- a/docs/nav.config.yml +++ b/docs/nav.config.yml @@ -45,6 +45,8 @@ components: name: Toast - title: 表单组件 items: + - title: 表单 + name: Form - title: 输入框 name: Input - title: 数字输入框 diff --git a/docs/view/Form/index.jsx b/docs/view/Form/index.jsx new file mode 100644 index 000000000..9c413590a --- /dev/null +++ b/docs/view/Form/index.jsx @@ -0,0 +1,10 @@ +import * as Nerv from 'nervjs' +import FormDoc from '@md/form.md' + +class FormView extends Nerv.Component { + render () { + return + } +} + +export default FormView diff --git a/docs/view/Form/index.scss b/docs/view/Form/index.scss new file mode 100644 index 000000000..e69de29bb