Blame view

src/Modal/Modal.js 800 Bytes
3a3ecabe   Imshann   init
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
  import template from "./Modal.html";
  import style from "antd/lib/modal/style/index.css";
  
  class Modal {
      useModules = ["esNgAntd"];
  
      props = {
          visible: Boolean,
          title: String,
          okText: String,
          cancelText: String,
          onOk: Function,
          onCancel: Function,
          width: Number,
          footer: String
      };
  
      state = {
          width: this.props.width || 416,
          okText: this.props.okText || "确定",
          cancelText: this.props.cancelText || "取消",
      };
  
      template = template;
  
      handleClose() {
          if (typeof this.props.onCancel === "function") {
              this.props.onCancel();
          }
      }
  
      constructor() {
          $element[0].removeAttribute("title");
          esNgAntd.createStyle("ant-modal", style);
      }
  }