mirror of
https://gitee.com/vant-contrib/vant-weapp.git
synced 2025-04-06 03:58:05 +08:00
[Doc] TreeSelect: update doc
This commit is contained in:
parent
d2c2c5c693
commit
7c7ab71ccd
@ -18,19 +18,17 @@ Page({
|
|||||||
children: config.pro2
|
children: config.pro2
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
||||||
mainActiveIndex: 0,
|
mainActiveIndex: 0,
|
||||||
|
|
||||||
activeId: 1002
|
activeId: 1002
|
||||||
},
|
},
|
||||||
|
|
||||||
handleNavClick({ detail = {} }) {
|
onNavClick({ detail = {} }) {
|
||||||
this.setData({
|
this.setData({
|
||||||
mainActiveIndex: detail.index || 0
|
mainActiveIndex: detail.index || 0
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
handleItemClick({ detail = {} }) {
|
onItemClick({ detail = {} }) {
|
||||||
this.setData({
|
this.setData({
|
||||||
activeId: detail.id
|
activeId: detail.id
|
||||||
});
|
});
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
"navigationBarTitleText": "Tree Select 分类选择",
|
"navigationBarTitleText": "Tree Select 分类选择",
|
||||||
"usingComponents": {
|
"usingComponents": {
|
||||||
|
"demo-block": "../../components/demo-block/index",
|
||||||
"van-tree-select": "../../dist/tree-select/index"
|
"van-tree-select": "../../dist/tree-select/index"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
<view style="margin-top: 5vh;">
|
<demo-block title="基础用法">
|
||||||
<van-tree-select
|
<van-tree-select
|
||||||
items="{{ items }}"
|
items="{{ items }}"
|
||||||
main-active-index="{{ mainActiveIndex }}"
|
main-active-index="{{ mainActiveIndex }}"
|
||||||
active-id="{{ activeId }}"
|
active-id="{{ activeId }}"
|
||||||
bind:itemclick="handleItemClick"
|
bind:itemclick="onItemClick"
|
||||||
bind:navclick="handleNavClick"
|
bind:navclick="onNavClick"
|
||||||
></van-tree-select>
|
></van-tree-select>
|
||||||
</view>
|
</demo-block>
|
||||||
|
@ -1,13 +1,12 @@
|
|||||||
## TreeSelect 分类选择
|
## TreeSelect 分类选择
|
||||||
|
|
||||||
### 使用指南
|
### 使用指南
|
||||||
|
|
||||||
在 index.json 中引入组件
|
在 index.json 中引入组件
|
||||||
```json
|
```json
|
||||||
{
|
|
||||||
"usingComponents": {
|
"usingComponents": {
|
||||||
"van-tree-select": "path/to/vant-weapp/dist/tree-select/index"
|
"van-tree-select": "path/to/vant-weapp/dist/tree-select/index"
|
||||||
}
|
}
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### 代码演示
|
### 代码演示
|
||||||
@ -17,8 +16,8 @@
|
|||||||
items="{{ items }}"
|
items="{{ items }}"
|
||||||
main-active-index="{{ mainActiveIndex }}"
|
main-active-index="{{ mainActiveIndex }}"
|
||||||
active-id="{{ activeId }}"
|
active-id="{{ activeId }}"
|
||||||
bind:navclick="handleNavClick"
|
bind:navclick="onNavClick"
|
||||||
bind:itemclick="handleItemClick"
|
bind:itemclick="onItemClick"
|
||||||
/>
|
/>
|
||||||
```
|
```
|
||||||
```javascript
|
```javascript
|
||||||
@ -27,13 +26,13 @@ Page({
|
|||||||
// ...
|
// ...
|
||||||
},
|
},
|
||||||
|
|
||||||
handleNavClick({ detail = {} }) {
|
onNavClick({ detail = {} }) {
|
||||||
this.setData({
|
this.setData({
|
||||||
mainActiveIndex: detail.index || 0
|
mainActiveIndex: detail.index || 0
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
handleItemClick({ detail = {} }) {
|
onItemClick({ detail = {} }) {
|
||||||
this.setData({
|
this.setData({
|
||||||
activeId: detail.id
|
activeId: detail.id
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user