Skip to content

Commit a6fd525

Browse files
committed
updated
1 parent 994570f commit a6fd525

File tree

3 files changed

+21
-19
lines changed

3 files changed

+21
-19
lines changed

src/components/ErrorList.js

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,23 @@ import React from "react";
33
export default function ErrorList(props) {
44
const { errors } = props;
55
return (
6-
<div className="panel panel-danger errors">
7-
<div className="panel-heading">
8-
<h3 className="panel-title">Errors</h3>
6+
<div className="ant-card ant-card-bordered">
7+
<div className="ant-card-head">
8+
<div className="ant-card-head-wrapper">
9+
<div className="ant-card-head-title">错误列表</div>
10+
</div>
11+
</div>
12+
<div className="ant-card-body">
13+
<ul>
14+
{errors.map((error, i) => {
15+
return (
16+
<li key={i} className="has-error">
17+
{error.stack}
18+
</li>
19+
);
20+
})}
21+
</ul>
922
</div>
10-
<ul className="list-group">
11-
{errors.map((error, i) => {
12-
return (
13-
<li key={i} className="list-group-item text-danger">
14-
{error.stack}
15-
</li>
16-
);
17-
})}
18-
</ul>
1923
</div>
2024
);
2125
}

src/components/Form.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,11 +252,11 @@ export default class Form extends Component {
252252
{children ? (
253253
children
254254
) : (
255-
<p>
255+
<div style={{ paddingTop: "15px" }}>
256256
<button type="submit" className="ant-btn ant-btn-primary">
257257
提交
258258
</button>
259-
</p>
259+
</div>
260260
)}
261261
</form>
262262
);

src/components/widgets/CheckboxWidget.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,16 @@ function CheckboxWidget(props) {
2222
<label
2323
className={`ant-checkbox-wrapper ${
2424
disabled || readonly ? "ant-checkbox-wrapper-disabled" : ""
25-
} ${
26-
typeof value === "undefined" ? "ant-checkbox-wrapper-checked" : ""
27-
}`}>
25+
} ${value ? "ant-checkbox-wrapper-checked" : ""}`}>
2826
<span
2927
className={`ant-checkbox ${
3028
disabled || readonly ? "ant-checkbox-disabled" : ""
31-
} ${typeof value === "undefined" ? "ant-checkbox-checked" : ""}`}>
29+
} ${value ? "ant-checkbox-checked" : ""}`}>
3230
<input
3331
type="checkbox"
3432
className="ant-checkbox-input"
3533
id={id}
36-
checked={typeof value === "undefined" ? false : value}
34+
checked={value}
3735
required={required}
3836
disabled={disabled || readonly}
3937
autoFocus={autofocus}

0 commit comments

Comments
 (0)