-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(schema-renderer): Fix expression complie perf bug (#986)
- Loading branch information
Showing
2 changed files
with
81 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
```jsx | ||
import React from 'react' | ||
import ReactDOM from 'react-dom' | ||
import { | ||
SchemaForm, | ||
Field, | ||
FormButtonGroup, | ||
Submit, | ||
Reset, | ||
Balloon, | ||
Icon | ||
} from '@formily/next' | ||
import { | ||
Input, | ||
ArrayTable, | ||
DatePicker, | ||
FormBlock, | ||
FormItemGrid, | ||
FormLayout | ||
} from '@formily/next-components' | ||
import '@alifd/next/dist/next.css' | ||
import Printer from '@formily/printer' | ||
|
||
const App = () => ( | ||
<Printer> | ||
<SchemaForm | ||
components={{ | ||
ArrayTable, | ||
Input, | ||
RangePicker: DatePicker.RangePicker | ||
}} | ||
> | ||
<FormLayout> | ||
<Field | ||
title="数组" | ||
name="array" | ||
maxItems={30} | ||
type="array" | ||
x-component="ArrayTable" | ||
x-component-props={{ | ||
renderExtraOperations() { | ||
return <div>Hello worldasdasdasdasd</div> | ||
}, | ||
operationsWidth: 300 | ||
}} | ||
> | ||
<Field type="object"> | ||
<Field | ||
name="aa" | ||
x-component="Input" | ||
description="hello world" | ||
title={ | ||
<div style={{ display: 'inline-block' }}> | ||
<span>字段1</span> | ||
<span>字段1</span> | ||
<span>字段1</span> | ||
<span>字段1</span> | ||
</div> | ||
} | ||
/> | ||
<Field | ||
key={0} | ||
name="bb" | ||
x-component="Input" | ||
title={() => { | ||
return <div>字段2</div> | ||
}} | ||
/> | ||
<Field key={1} name="cc" x-component="Input" title={'字段3'} /> | ||
<Field key={3} name="ee" x-component="Input" title={'字段5'} /> | ||
</Field> | ||
</Field> | ||
</FormLayout> | ||
</SchemaForm> | ||
</Printer> | ||
) | ||
ReactDOM.render(<App />, document.getElementById('root')) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters