2018-07-11 09:51:20 +00:00
|
|
|
<cn>
|
|
|
|
#### 基本用法
|
|
|
|
最简单的用法。
|
|
|
|
</cn>
|
|
|
|
|
|
|
|
<us>
|
|
|
|
#### Basic
|
|
|
|
The most basic usage.
|
|
|
|
</us>
|
|
|
|
|
|
|
|
```html
|
|
|
|
<template>
|
|
|
|
<a-tree-select
|
|
|
|
showSearch
|
|
|
|
style="width: 300px"
|
|
|
|
:value="value"
|
|
|
|
:dropdownStyle="{ maxHeight: '400px', overflow: 'auto' }"
|
|
|
|
placeholder='Please select'
|
|
|
|
allowClear
|
|
|
|
treeDefaultExpandAll
|
|
|
|
@change="onChange"
|
|
|
|
>
|
|
|
|
<a-tree-select-node value='parent 1' title='parent 1' key='0-1'>
|
|
|
|
<a-tree-select-node value='parent 1-0' title='parent 1-0' key='0-1-1'>
|
2018-12-25 04:00:39 +00:00
|
|
|
<a-tree-select-node :selectable="false" value='leaf1' title='my leaf' key='random' />
|
2018-07-11 09:51:20 +00:00
|
|
|
<a-tree-select-node value='leaf2' title='your leaf' key='random1' />
|
|
|
|
</a-tree-select-node>
|
|
|
|
<a-tree-select-node value='parent 1-1' title='parent 1-1' key='random2'>
|
|
|
|
<a-tree-select-node value='sss' key='random3'>
|
|
|
|
<b style="color: #08c" slot="title">sss</b>
|
|
|
|
</a-tree-select-node>
|
|
|
|
</a-tree-select-node>
|
|
|
|
</a-tree-select-node>
|
|
|
|
</a-tree-select>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
|
|
|
export default {
|
|
|
|
data () {
|
|
|
|
return {
|
2018-12-25 04:00:39 +00:00
|
|
|
treeExpandedKeys: [],
|
2018-07-11 09:51:20 +00:00
|
|
|
value: undefined,
|
|
|
|
}
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
onChange (value) {
|
2018-12-25 04:00:39 +00:00
|
|
|
console.log(value)
|
2018-07-11 09:51:20 +00:00
|
|
|
this.value = value
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
```
|