fix: action buttons align right

This commit is contained in:
chenos 2021-01-02 09:21:07 +08:00
parent 7ce22d7267
commit 2689e070f1

View File

@ -1,6 +1,6 @@
import React, { useState, useEffect, useImperativeHandle, forwardRef, useRef } from 'react'; import React, { useState, useEffect, useImperativeHandle, forwardRef, useRef } from 'react';
import { Button, Drawer } from 'antd'; import { Button, Drawer } from 'antd';
import { Tooltip, Input } from 'antd'; import { Tooltip, Input, Space } from 'antd';
import { import {
SchemaForm, SchemaForm,
SchemaMarkupField as Field, SchemaMarkupField as Field,
@ -53,13 +53,22 @@ export default forwardRef((props: any, ref) => {
setVisible(false); setVisible(false);
}} }}
title={title} title={title}
footer={[ footer={(
<Button type={'primary'} onClick={async () => { <div
const { values = {} } = await actions.submit(); style={{
setVisible(false); textAlign: 'right',
onFinish && onFinish(values, index); }}
}}></Button> >
]} <Space>
<Button onClick={() => setVisible(false)}></Button>
<Button type={'primary'} onClick={async () => {
const { values = {} } = await actions.submit();
setVisible(false);
onFinish && onFinish(values, index);
}}></Button>
</Space>
</div>
)}
> >
<SchemaForm <SchemaForm
colon={true} colon={true}