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