Skip to content

Commit

Permalink
feat: title add showColon configuration (#199)
Browse files Browse the repository at this point in the history
  • Loading branch information
mengshang918 authored May 4, 2022
1 parent 47a5960 commit d8d32ef
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/drip-form/src/components/Title/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ const Title = memo<TitleType>(
''
)}
{title}
{titleUi?.showColon && ':'}
{description &&
description?.type === 'icon' &&
description?.title &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,21 @@ const unitedSchema = {
vcontrol: 'return props.formData.title.followRootConfig == false',
},
},
{
fieldKey: 'showColon',
type: 'boolean',
title: '是否展示:号',
default: false,
ui: {
type: 'switch',
description: {
title: '开启后,形式为标题:',
type: 'icon',
trigger: 'hover',
},
vcontrol: 'return props.formData.title.followRootConfig == false',
},
},
{
fieldKey: 'width',
type: 'number',
Expand Down
14 changes: 14 additions & 0 deletions packages/generator/src/fields/container/root.field.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,20 @@ const unitedSchema = [
},
},
},
{
fieldKey: 'showColon',
type: 'boolean',
title: '是否展示:号',
default: false,
ui: {
type: 'switch',
description: {
title: '开启后,形式为标题:',
type: 'icon',
trigger: 'hover',
},
},
},
{
fieldKey: 'placement',
type: 'object',
Expand Down
1 change: 1 addition & 0 deletions packages/utils/src/schemaHandle/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ export type TitleUi = Partial<{
placement: TitlePlacement
color: string
fontSize: number | string
showColon?: boolean
}> | null

type Properties = {
Expand Down

0 comments on commit d8d32ef

Please sign in to comment.