<commit_before># 基本

- order: 0

最简单的用法。

---

````jsx
import { TreeSelect } from 'antd';
const TreeNode = TreeSelect.TreeNode;

const Demo = React.createClass({
  getInitialState() {
    return {
      value: '1',
    };
  },
  onChange(e) {
    let value;
    if (e.target) {
      value = e.target.value;
    } else {
      value = e;
    }
    this.setState({value});
  },
  render() {
    return (
      <div style={{margin: 20}}>
        <h2>Single Select</h2>
        <TreeSelect style={{width: 300}} showSearch
              value={this.state.value}
              dropdownMenuStyle={{maxHeight: 200, overflow: 'auto'}}
              treeProps={{defaultExpandAll: true}}
              onChange={this.onChange}>
          <TreeNode value="parent 1" title="parent 1" key="0-1">
            <TreeNode value="parent 1-0" title="parent 1-0" key="0-1-1">
              <TreeNode value="leaf" title="leaf" key="random" />
              <TreeNode value="leaf" title="leaf" />
            </TreeNode>
            <TreeNode value="parent 1-1" title="parent 1-1">
              <TreeNode value="sss" title={<span style={{color: 'red'}}>sss</span>} />
            </TreeNode>
          </TreeNode>
        </TreeSelect>
      </div>
    );
  },
});

ReactDOM.render(
  <Demo />
, document.getElementById('components-tree-select-demo-basic'));
````<commit_msg>fix demo<commit_after># 基本

- order: 0

最简单的用法。

---

````jsx
import { TreeSelect } from 'antd';
const TreeNode = TreeSelect.TreeNode;

const Demo = React.createClass({
  getInitialState() {
    return {
      value: '1',
    };
  },
  onChange(e) {
    let value;
    if (e.target) {
      value = e.target.value;
    } else {
      value = e;
    }
    this.setState({value});
  },
  render() {
    return (
      <div style={{margin: 20}}>
        <h2>Single Select</h2>
        <TreeSelect style={{width: 300}} showSearch
              value={this.state.value}
              dropdownMenuStyle={{maxHeight: 200, overflow: 'auto'}}
              treeProps={{defaultExpandAll: true}}
              onChange={this.onChange}>
          <TreeNode value="parent 1" title="parent 1" key="0-1">
            <TreeNode value="parent 1-0" title="parent 1-0" key="0-1-1">
              <TreeNode value="leaf" title="leaf" key="random" />
              <TreeNode value="leaf" title="leaf" key="random1" />
            </TreeNode>
            <TreeNode value="parent 1-1" title="parent 1-1" key="random2">
              <TreeNode value="sss" title={<span style={{color: 'red'}}>sss</span>} key="random3" />
            </TreeNode>
          </TreeNode>
        </TreeSelect>
      </div>
    );
  },
});

ReactDOM.render(
  <Demo />
, document.getElementById('components-tree-select-demo-basic'));
````
{'fraction_non_alphanumeric': 0.17522768670309655, 'fraction_numerical': 0.020765027322404372, 'mean_word_length': 2.18931475029036, 'pattern_counts': {'":': 0, '<': 39, '<?xml version=': 0, '>': 39, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6522771', 'n_tokens_mistral': 929, 'n_tokens_neox': 908, 'n_words': 178}