add cancel button to markdown
This commit is contained in:
parent
52699b0302
commit
35cafad0ff
@ -63,8 +63,15 @@ function MarkdownTextArea(props: any) {
|
||||
setValue(e.target.value);
|
||||
}}
|
||||
/>
|
||||
<Space style={{ position: 'absolute', bottom: 5, right: 5 }}>
|
||||
<Button
|
||||
onClick={(e) => {
|
||||
props.onCancel && props.onCancel(e);
|
||||
}}
|
||||
>
|
||||
取消
|
||||
</Button>
|
||||
<Button
|
||||
style={{ position: 'absolute', bottom: 5, right: 5 }}
|
||||
type={'primary'}
|
||||
onClick={() => {
|
||||
props.onSubmit && props.onSubmit(value);
|
||||
@ -72,6 +79,7 @@ function MarkdownTextArea(props: any) {
|
||||
>
|
||||
保存
|
||||
</Button>
|
||||
</Space>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@ -90,6 +98,9 @@ Markdown.Void = observer((props: any) => {
|
||||
<MarkdownTextArea
|
||||
{...props}
|
||||
defaultValue={schema['default']}
|
||||
onCancel={() => {
|
||||
field.readPretty = true;
|
||||
}}
|
||||
onSubmit={async (value) => {
|
||||
field.readPretty = true;
|
||||
schema['default'] = value;
|
||||
|
Loading…
Reference in New Issue
Block a user