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