[Doc] new theme
This commit is contained in:
@@ -1,15 +1,16 @@
|
||||
## TreeSelect
|
||||
# TreeSelect
|
||||
|
||||
### Install
|
||||
|
||||
``` javascript
|
||||
import { TreeSelect } from 'vant';
|
||||
|
||||
Vue.use(TreeSelect);
|
||||
```
|
||||
|
||||
### Usage
|
||||
## Usage
|
||||
|
||||
#### Basic Usage
|
||||
### Basic Usage
|
||||
|
||||
```html
|
||||
<van-tree-select
|
||||
@@ -43,9 +44,9 @@ export default {
|
||||
}
|
||||
```
|
||||
|
||||
### Props
|
||||
## API
|
||||
|
||||
#### Props
|
||||
### Props
|
||||
|
||||
| Attribute | Description | Type | Default |
|
||||
|------|------|------|------|
|
||||
@@ -54,7 +55,7 @@ export default {
|
||||
| main-Active-index | The index of selected parent node | `Number` | `0` |
|
||||
| active-id | Id of selected item | `String | Number` | `0` |
|
||||
|
||||
#### Events
|
||||
### Events
|
||||
|
||||
| Event | Description | Arguments |
|
||||
|------|------|------|
|
||||
@@ -62,6 +63,7 @@ export default {
|
||||
| itemclick | triggered when item is selected | data: selected item |
|
||||
|
||||
### Data Structure
|
||||
|
||||
`items` should be an array contains specified tree objects.
|
||||
|
||||
In every tree object, `text` property defines `id` stands for the unique key while the `children` contains sub-tree objects.
|
||||
|
||||
@@ -1,15 +1,16 @@
|
||||
## TreeSelect 分类选择
|
||||
# TreeSelect 分类选择
|
||||
|
||||
### 引入
|
||||
|
||||
### 使用指南
|
||||
``` javascript
|
||||
import { TreeSelect } from 'vant';
|
||||
|
||||
Vue.use(TreeSelect);
|
||||
```
|
||||
|
||||
### 代码演示
|
||||
## 代码演示
|
||||
|
||||
#### 基础用法
|
||||
### 基础用法
|
||||
|
||||
```html
|
||||
<van-tree-select
|
||||
@@ -43,9 +44,9 @@ export default {
|
||||
}
|
||||
```
|
||||
|
||||
### Props
|
||||
## API
|
||||
|
||||
#### 传入参数
|
||||
### Props
|
||||
|
||||
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|
||||
|------|------|------|------|------|
|
||||
@@ -54,18 +55,19 @@ export default {
|
||||
| main-active-index | 左侧导航高亮的索引 | `Number` | `0` | - |
|
||||
| active-id | 右侧选择项,高亮的数据id | `String | Number` | `0` | - |
|
||||
|
||||
#### 事件
|
||||
### Events
|
||||
|
||||
| 事件名 | 说明 | 回调参数 |
|
||||
|------|------|------|
|
||||
| navclick | 左侧导航点击时,触发的事件 | index:被点击的导航的索引 |
|
||||
| itemclick | 右侧选择项被点击时,会触发的事件 | data: 该点击项的数据 |
|
||||
|
||||
### 数据格式
|
||||
#### items 分类显示所需数据的数据结构
|
||||
### items 分类显示所需数据的数据结构
|
||||
|
||||
`items` 整体为一个数组,数组内包含一系列描述分类的对象。
|
||||
|
||||
每个分类里,text 表示当前分类的名称。children 表示分类里的可选项,为数组结构,id 被用来唯一标识每个选项
|
||||
|
||||
```javascript
|
||||
[
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user