Skip to content

Commit

Permalink
fix: component-props,decorator-props label -> props title
Browse files Browse the repository at this point in the history
  • Loading branch information
yaoleyaotouoO committed Mar 11, 2022
1 parent d5b98f0 commit f08ce7e
Show file tree
Hide file tree
Showing 29 changed files with 120 additions and 172 deletions.
2 changes: 1 addition & 1 deletion docs/demos/guide/area/json-schema.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export default {
data() {
const schema = {
type: 'object',
title: '城市',
properties: {
area: {
type: 'array',
Expand All @@ -34,7 +35,6 @@ export default {
.filter((item) => !!item)
.map((item) => item && item.name)
.join('/'),
label: '城市',
placeholder: '选择城市',
},
popupProps: {},
Expand Down
2 changes: 1 addition & 1 deletion docs/demos/guide/area/markup-schema.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
<SchemaField>
<SchemaStringField
name="area"
title="城市"
x-component="Area"
:x-component-props="{
formItemProps: {
label: '城市',
placeholder: '选择城市',
format: (val) =>
(val || [])
Expand Down
2 changes: 1 addition & 1 deletion docs/demos/guide/area/template.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<Form :form="form">
<Field
name="area"
title="城市"
:component="[
Area,
{
Expand All @@ -11,7 +12,6 @@
.filter((item) => !!item)
.map((item) => item && item.name)
.join('/'),
label: '城市',
placeholder: '选择城市',
},
popupProps: {},
Expand Down
2 changes: 1 addition & 1 deletion docs/demos/guide/calendar/json-schema.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ export default {
properties: {
calendar: {
type: 'string',
title: '日历',
'x-component': 'Calendar',
'x-component-props': {
formItemProps: {
label: '日历',
placeholder: '选择日历',
format: (date) =>
date && `${date.getMonth() + 1}/${date.getDate()}`,
Expand Down
2 changes: 1 addition & 1 deletion docs/demos/guide/calendar/markup-schema.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
<SchemaField>
<SchemaStringField
name="calendar"
title="日历"
x-component="Calendar"
:x-component-props="{
formItemProps: {
label: '日历',
placeholder: '选择日历',
format: (date) =>
date && `${date.getMonth() + 1}/${date.getDate()}`,
Expand Down
2 changes: 1 addition & 1 deletion docs/demos/guide/calendar/template.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
<Form :form="form">
<Field
name="calendar"
title="日历"
:component="[
Calendar,
{
formItemProps: {
label: '日历',
placeholder: '选择日历',
format: (date) =>
date && `${date.getMonth() + 1}/${date.getDate()}`,
Expand Down
2 changes: 1 addition & 1 deletion docs/demos/guide/cascader/json-schema.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ export default {
properties: {
cascader: {
type: 'string',
title: '地区',
'x-component': 'Cascader',
'x-component-props': {
formItemProps: {
label: '地区',
placeholder: '请选择所在地区',
format: (data) => {
const { selectedOptions = [] } = data || {}
Expand Down
2 changes: 1 addition & 1 deletion docs/demos/guide/cascader/markup-schema.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
<SchemaField>
<SchemaStringField
name="cascader"
title="地区"
x-component="Cascader"
:x-component-props="{
formItemProps: {
label: '地区',
placeholder: '请选择所在地区',
format: (data) => {
const { selectedOptions = [] } = data || {}
Expand Down
2 changes: 1 addition & 1 deletion docs/demos/guide/cascader/template.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
<Form :form="form">
<Field
name="cascader"
title="地区"
:component="[
Cascader,
{
formItemProps: {
label: '地区',
placeholder: '请选择所在地区',
format: (data) => {
const { selectedOptions = [] } = data || {}
Expand Down
2 changes: 1 addition & 1 deletion docs/demos/guide/checkbox/json-schema.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ const schema = {
properties: {
single: {
type: 'boolean',
title: '选项',
'x-component': 'Checkbox',
'x-component-props': { label: '选项' },
},
multiple: {
type: 'array',
Expand Down
6 changes: 1 addition & 5 deletions docs/demos/guide/checkbox/markup-schema.vue
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
<template>
<Form class="checkbox" :form="form">
<SchemaField>
<SchemaBooleanField
name="single"
x-component="Checkbox"
:x-component-props="{ label: '选项' }"
/>
<SchemaBooleanField name="single" title="选项" x-component="Checkbox" />
<SchemaArrayField
name="multiple"
:enum="[
Expand Down
2 changes: 1 addition & 1 deletion docs/demos/guide/checkbox/template.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<Form class="checkbox" :form="form">
<Field name="single" :component="[Checkbox, { label: '选项' }]" />
<Field name="single" title="选项" :component="[Checkbox]" />
<ArrayField
name="multiple"
:dataSource="[
Expand Down
2 changes: 1 addition & 1 deletion docs/demos/guide/datetime-picker/json-schema.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ export default {
properties: {
datetimePicker: {
type: 'string',
title: '时间选择器',
'x-component': 'DatetimePicker',
'x-component-props': {
formItemProps: {
label: '时间选择器',
placeholder: '请选择时间',
},
popupProps: {},
Expand Down
2 changes: 1 addition & 1 deletion docs/demos/guide/datetime-picker/markup-schema.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
<SchemaField>
<SchemaStringField
name="datetimePicker"
title="时间选择器"
x-component="DatetimePicker"
:x-component-props="{
formItemProps: {
label: '时间选择器',
placeholder: '请选择时间',
},
popupProps: {},
Expand Down
2 changes: 1 addition & 1 deletion docs/demos/guide/datetime-picker/template.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
<Form :form="form">
<Field
name="datetimePicker"
title="时间选择器"
:component="[
DatetimePicker,
{
formItemProps: {
label: '时间选择器',
placeholder: '请选择时间',
},
popupProps: {},
Expand Down
45 changes: 15 additions & 30 deletions docs/demos/guide/form/markup-schema-verify.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,16 @@
<SchemaField>
<SchemaStringField
name="input"
title="输入框"
x-component="Input"
:x-component-props="{ label: '输入框', placeholder: '请输入' }"
:x-component-props="{ placeholder: '请输入' }"
required
/>

<SchemaStringField
name="switch"
title="开关"
x-decorator="FormItem"
:x-decorator-props="{
label: '开关',
}"
x-component="Switch"
:x-component-props="{
size: 20,
Expand All @@ -22,10 +21,8 @@

<SchemaStringField
name="checkbox"
title="复选框"
x-decorator="FormItem"
:x-decorator-props="{
label: '复选框',
}"
x-component="Checkbox"
:x-component-props="{
shape: 'square',
Expand All @@ -35,10 +32,8 @@

<SchemaArrayField
name="checkboxGroup"
title="复选框组"
x-decorator="FormItem"
:x-decorator-props="{
label: '复选框组',
}"
:enum="[
{ label: '复选框 1', name: 1, shape: 'square' },
{ label: '复选框 2', name: 2, shape: 'square' },
Expand All @@ -51,10 +46,10 @@

<SchemaArrayField
name="radio"
title="单选框"
x-decorator="FormItem"
:x-decorator-props="{
asterisk: true,
label: '单选框',
}"
:enum="[
{ label: '单选框 1', name: 1 },
Expand All @@ -75,46 +70,38 @@

<SchemaStringField
name="stepper"
title="步进器"
x-decorator="FormItem"
:x-decorator-props="{
label: '步进器',
}"
x-component="Stepper"
/>

<SchemaStringField
name="rate"
title="评分"
x-decorator="FormItem"
:x-decorator-props="{
label: '评分',
}"
x-component="Rate"
/>

<SchemaStringField
name="slider"
title="滑块"
x-decorator="FormItem"
:x-decorator-props="{
label: '滑块',
}"
x-component="Slider"
/>

<SchemaStringField
name="uploader"
title="文件上传"
x-decorator="FormItem"
:x-decorator-props="{
label: '文件上传',
}"
x-component="Uploader"
/>

<SchemaStringField
name="picker"
title="选择器"
x-component="Picker"
:x-component-props="{
formItemProps: {
label: '选择器',
placeholder: '点击选择城市',
},
pickerProps: {
Expand All @@ -139,10 +126,10 @@

<SchemaStringField
name="datetimePicker"
title="时间选择"
x-component="DatetimePicker"
:x-component-props="{
formItemProps: {
label: '时间选择',
placeholder: '点击选择时间',
},
popupProps: {},
Expand All @@ -157,10 +144,10 @@

<SchemaStringField
name="area"
title="地区选择"
x-component="Area"
:x-component-props="{
formItemProps: {
label: '地区选择',
placeholder: '点击选择省市区',
format: (val) =>
(val || [])
Expand Down Expand Up @@ -193,10 +180,10 @@

<SchemaStringField
name="calendar"
title="日历"
x-component="Calendar"
:x-component-props="{
formItemProps: {
label: '日历',
placeholder: '选择日历',
format: (date) =>
date && `${date.getMonth() + 1}/${date.getDate()}`,
Expand All @@ -208,9 +195,7 @@
/>
</SchemaField>

<Submit :style="{ 'margin-top': '16px' }" round block>
提交
</Submit>
<Submit :style="{ 'margin-top': '16px' }" round block> 提交 </Submit>
</Form>
</template>

Expand Down
Loading

0 comments on commit f08ce7e

Please sign in to comment.