Blame view

src/Option/Option.js 375 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
  /**
   * 选项
   */
  import template from "./Option.html";
  
  class Option {
      props = { value: String };
  
      state = {
          label: null,
      };
  
      template = template;
  
      constructor(esSelect) {
          this.esSelect = esSelect.getContext();
          this.esSelect.addOption({
              value: this.props.value,
              label: $element.text(),
          });
      }
  }