You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
help_user/src/my/MyDialog.tsx

42 lines
1.2 KiB

import React from "react";
import Dialog from "@material-ui/core/Dialog";
import Draggable from "react-draggable";
import {Paper} from "@material-ui/core";
import {MyDialogProps} from "../entity";
import {CloseDialog} from "./CloseDialog";
/**
* 我的弹窗
*/
export class MyDialog extends React.Component<MyDialogProps, any>{
constructor(props: Readonly<MyDialogProps>) {
super(props);
this.state={
titleId:"my-dialog"
}
}
render() {
return (
<Dialog
hideBackdrop={true}
open={this.props.open}
PaperComponent={(props)=>
<Draggable handle={"#"+this.state.titleId} cancel={'[class*="MuiDialogContent-root"]'}>
<Paper {...props} />
</Draggable>}
aria-labelledby={this.state.titleId}
classes={{paper:"w-100"}}
>
<CloseDialog menuName={this.props.menuName} onClose={()=>this.props.onClose()} titleId={this.state.titleId}/>
<div className="p-3">
{this.props.content}
</div>
</Dialog>
);
}
}