Antd可拖动模态框简单封装(修改版本)

import  React from 'react';
import DragM from 'dragm';
import Modal from "../../node_modules/antd/lib/modal/Modal";
class ModalTitle 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 (
      
        
{title}
); } } export default class SeniorModal extends React.Component{ render() { const title = ; return ( {this.props.children} ); } }

 

你可能感兴趣的:(React学习note)