import React from "react";
import { render } from "react-dom";
import DragM from "dragm";
import { Modal, Button } from "antd";
import "antd/dist/antd.css";
class BuildTitle extends React.Component {
updateTransform = transformStr => {
this.modalDom.style.transform = transformStr;
};
componentDidMount() {
this.modalDom = document.getElementsByClassName(
"ant-modal-wrap" //modal的class是ant-modal-wrap
)[0];
}
render() {
const { title } = this.props;
return (
);
}
}
class App extends React.Component {
state = { visible: false };
showModal = () => {
this.setState({
visible: true
});
};
handleOk = e => {
this.setState({
visible: false
});
};
handleCancel = e => {
this.setState({
visible: false
});
};
render() {
const title = ;
return (
Open
title={title}
visible={this.state.visible}
onOk={this.handleOk}
onCancel={this.handleCancel}
>
{this.state.text}
Some contents...
Some contents...
);
}
}
render(, document.getElementById("root"));