Skip to content

Commit

Permalink
fix(Form): 去除最后一项不展示下划线
Browse files Browse the repository at this point in the history
  • Loading branch information
ChenlingasMx committed Mar 13, 2023
1 parent 8b89d66 commit 5425516
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion example/examples/src/routes/Form/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ const FormDemo = () => {
return (
<Container>
<Layout>
<Body>
<Body style={{backgroundColor: '#fff'}}>
<Form
form={form}
schema={schema}
Expand Down
3 changes: 1 addition & 2 deletions packages/core/src/Form/formItems.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,12 @@ const FormItems = ({ schema = [] }: Pick<FormProps, 'schema'>) => {

const _render = () => {
return schema.map((v: FormItemsProps, i: number) => {
const last = schema.length - 1 === i;
if (v.hide) {
return null;
}
return (
<View key={i} style={styles.form_items_container}>
<View style={[styles.form_items, last && styles.border_none]}>
<View style={[styles.form_items]}>
<Label v={v} />
{_renderComponent(v)}
<Tip v={v} />
Expand Down

0 comments on commit 5425516

Please sign in to comment.