Skip to content

Commit

Permalink
docs(omi-form): fix error of playground
Browse files Browse the repository at this point in the history
  • Loading branch information
dntzhang committed Jan 4, 2024
1 parent c4aba1d commit 73f66ba
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
8 changes: 5 additions & 3 deletions packages/omi-form/examples/playground.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,12 @@ const config = {
description: 'Make sure it matches your legal name',
type: 'group',
components: [
{ type: 'input', value: '', placeholder: 'First Name', column: 6 },
{ type: 'input', value: '', placeholder: 'Last Name', column: 6 },
{ type: 'input', name: 'first', placeholder: 'First Name', column: 6 },
{ type: 'input', name: 'last', placeholder: 'Last Name', column: 6 },
],
},
{
type: 'input',
value: '',
name: 'birthday',
placeholder: 'Birthday',
label: 'Birthday',
Expand Down Expand Up @@ -93,6 +92,7 @@ const config = {
{
type: 'input',
label: 'Email',
name: 'Email',
placeholder: 'Email',
value: 'john.doe@example.com',
description: 'You will receive a confirmation letter to this email.',
Expand All @@ -118,10 +118,12 @@ const config = {
// },
{
type: 'checkbox',
name: 'terms',
text: 'I accept the Terms & Conditions & Privacy Policy',
},
{
type: 'checkbox',
name: 'marketing',
text: 'I want to recieve marketing emails',
},
],
Expand Down
2 changes: 1 addition & 1 deletion packages/omi-form/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "omi-form",
"version": "0.0.17",
"version": "0.0.18",
"description": "Powerful, simple and cross frameworks form solution.",
"main": "dist/index.es.js",
"exports": {
Expand Down
5 changes: 1 addition & 4 deletions packages/omi-form/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,6 @@ export class Form extends Component<FormProps> {

renderComponent = (
component: FormComponent,
index: number,
components: FormComponent[],
level: number
) => {
Expand Down Expand Up @@ -293,7 +292,6 @@ export class Form extends Component<FormProps> {
>
{this.renderComponent(
item,
i,
// @ts-ignore
component.items,
level + 1
Expand Down Expand Up @@ -325,7 +323,6 @@ export class Form extends Component<FormProps> {
{component.components &&
this.renderComponent(
childComponent,
i,
component.components,
level + 1
)}
Expand Down Expand Up @@ -482,7 +479,7 @@ export class Form extends Component<FormProps> {
>
{this.config.components.map((component, index) => (
<div style={`grid-column: span ${component.column || 12}`}>
{this.renderComponent(component, index, this.config.components, 0)}
{this.renderComponent(component, this.config.components, 0)}
</div>
))}

Expand Down

0 comments on commit 73f66ba

Please sign in to comment.