Skip to content

Commit

Permalink
fix(ProForm): 统一标题样式及组件样式微调
Browse files Browse the repository at this point in the history
  • Loading branch information
yaob421123 committed Apr 19, 2023
1 parent 8f0b188 commit d528e6f
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 7 deletions.
13 changes: 9 additions & 4 deletions packages/components/src/ProForm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1172,10 +1172,15 @@ import { formatter, Input, Button } from 'uiw'
import React, { useState } from 'react';

const Inputs = ({value, onChange}) => {
return <>
<Button>不要输错哦</Button>
<Input placeholder="请输入内容" value={value} onChange={e => { onChange(e.target.value) }} />
</>
return (
<>
<Button style={{ marginRight: 10, width: 200 }}>按钮</Button>
<Input
placeholder="请输入内容"
value={value}
onChange={e => { onChange(e.target.value) }} />
</>
)
}

const Demo = () => {
Expand Down
8 changes: 7 additions & 1 deletion packages/components/src/ProForm/formdom.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import './style/form-item.css';
function FormDom({
formDatas = [],
formfields,
formType,
onSubmit,
onChange,
onSubmitError,
Expand All @@ -29,6 +30,8 @@ function FormDom({
const store = useStore();
const colProps = useColPropsContext();

console.log(8888, formType);

const { setFormState } = store as {
setFormState: ((p: any) => void) | undefined;
};
Expand All @@ -44,11 +47,14 @@ function FormDom({
}, [baseRef]);

const styles: React.CSSProperties = {
background: '#fff',
paddingBottom: 10,
...style,
};

if (formType !== 'pure') {
styles.background = '#fff';
}

return (
<Form
className={className}
Expand Down
25 changes: 23 additions & 2 deletions packages/components/src/ProForm/style/form-item.css
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,27 @@
}

.uiw-admin-proform .w-card-head {
height: 50px;
line-height: 50px;
height: 44px;
line-height: 44px;
}
.uiw-admin-proform .w-descriptions-title {
height: 44px;
display: flex;
align-items: center;
}
.uiw-admin-proform .w-collapse-header {
height: 44px;
align-items: center;
font-weight: 500;
}
.uiw-admin-proform > .w-descriptions {
border-top: none;
}
.uiw-admin-proform > .w-descriptions .w-descriptions-title {
width: 100%;
display: table-caption;
box-sizing: border-box;
line-height: 44px;
border-top: 1px solid #dfe2e5;
padding: 0 12px;
}

0 comments on commit d528e6f

Please sign in to comment.