You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ant-design-vue/components/form/demo/index.vue

103 lines
3.1 KiB

7 years ago
<script>
// import AdvancedSearch from './advanced-search'
7 years ago
// import Coordinated from './coordinated'
// import CustomizedFormControls from './customized-form-controls'
// import DynamicFormItem from './dynamic-form-item'
// import DynamicRule from './dynamic-rule'
// import FormInModal from './form-in-modal'
// import GlobalState from './global-state'
// import HorizontalLogin from './horizontal-login'
// import Layout from './layout'
// import NormalLogin from './normal-login'
// import Register from './register'
// import TimeRelatedControls from './time-related-controls'
// import ValidateOther from './validate-other'
// import ValidateStatic from './validate-static'
// import WithoutFormCreate from './without-form-create'
import Test from './test'
import TestString from '!raw-loader!./test'
7 years ago
import CN from './../index.zh-CN'
import US from './../index.en-US'
const md = {
cn: `# Form 表单
具有数据收集校验和提交功能的表单包含复选框单选框输入框下拉选择框等元素
## 表单
我们为 \`form\` 提供了以下三种排列方式:
- 水平排列标签和表单控件水平排列默认
- 垂直排列标签和表单控件上下垂直排列
- 行内排列表单项水平行内排列
## 表单域
表单一定会包含表单域表单域可以是输入控件标准表单域标签下拉菜单文本域等
这里我们封装了表单域 \`<Form.Item />\`
**注意** 如果使用 \`Form.create\` 处理表单使其具有自动收集数据并校验的功能,建议使用\`jsx\`
## 代码演示
`,
us: `# Form
Form is used to collect, validate, and submit the user input, usually contains various form items including checkbox, radio, input, select, and etc.
## Form
You can align the controls of a \`form\` using the \`layout\` prop
- \`horizontal\`to horizontally align the \`label\`s and controls of the fields. (Default)
- \`vertical\`to vertically align the \`label\`s and controls of the fields.
- \`inline\`to render form fields in one line.
## Form fields
A form consists of one or more form fields whose type includes input, textarea, checkbox, radio, select, tag, and more.
A form field is defined using \`<Form.Item />\`.
**Note:** If you use \`Form.create\` to process forms with automatic data collection and validation, we recommend using \`jsx\`
## Examples
`,
}
export default {
category: 'Components',
subtitle: '表单',
type: 'Data Entry',
cols: 1,
title: 'Form',
render () {
console.log(TestString)
7 years ago
return (
<div>
<md cn={md.cn} us={md.us} />
<Test />
{/* <AdvancedSearch />
<Coordinated />
7 years ago
<CustomizedFormControls />
<DynamicFormItem />
<DynamicRule />
<FormInModal />
<GlobalState />
<HorizontalLogin />
<Layout />
<NormalLogin />
<Register />
<TimeRelatedControls />
<ValidateStatic />
<WithoutFormCreate />
<ValidateOther />
*/}
<api>
<CN slot='cn' />
<US />
</api>
</div>
)
},
}
</script>