@aliretail/react-materials-components
Version:
55 lines (51 loc) • 1.21 kB
Markdown
---
title: Transfer - 穿梭框
order: 140
---
```jsx
import React from 'react';
import ReactDOM from 'react-dom';
import { FormComponents } from '@aliretail/react-materials-components';
const { Transfer, SchemaForm, SchemaMarkupField: Field, createFormActions } = FormComponents;
const App = () => {
return (
<SchemaForm
components={{
Transfer,
}}
onChange={console.log}
defaultValue={{
readOnly: ['1', '2'],
}}
>
<Field
x-component="Transfer"
title="Transfer"
name="Transfer"
enum={[
{ label: 'One', value: '1' },
{ label: 'Two', value: '2' },
{ label: 'Three', value: '3' },
{ label: 'Four', value: '4' },
]}
x-component-props={{
showSearch: true,
}}
/>
<Field
x-component="Transfer"
title="readOnly"
name="readOnly"
enum={[
{ label: 'One', value: '1' },
{ label: 'Two', value: '2' },
{ label: 'Three', value: '3' },
{ label: 'Four', value: '4' },
]}
readOnly
/>
</SchemaForm>
);
};
ReactDOM.render(<App />, mountNode);
```