Merge pull request #542 from RickCole21/master

补充nav文档
This commit is contained in:
liaoxuezhi 2020-04-09 20:25:44 +08:00 committed by GitHub
commit 08a03f45b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 66 additions and 11 deletions

View File

@ -1,10 +1,11 @@
## Nav
| 属性名 | 类型 | 默认值 | 说明 |
| ----------------- | --------- | -------- | -------------------------------------- |
| ----------------- | ----------------- | -------- | ------------------------------------------- |
| type | `string` | `"tabs"` | 指定为 Nav 渲染器 |
| className | `string` | | 外层 Dom 的类名 |
| stacked | `boolean` | `true` | 设置成 false 可以以 tabs 的形式展示 |
| source | `Api``string` | | 动态拉取的 api 地址,也支持`${xxx}`获取变量 |
| links | `Array` | | 链接集合 |
| links[x].label | `string` | | 名称 |
| links[x].to | `string` | | 链接地址 |
@ -63,3 +64,57 @@
]
}
```
## source 返回格式
```json
{
"status": 0,
"msg": "",
"data": [
{
"label": "Nav 1",
"to": "/docs/index",
"icon": "fa fa-user"
},
{
"label": "Nav 2",
"to": "/docs/api"
},
{
"label": "Nav 3",
"to": "/docs/renderers"
}
]
}
```
或者
```json
{
"status": 0,
"msg": "",
"data": {
"links": [ // 可选字段值options, items, rows
{
"label": "Nav 1",
"to": "/docs/index",
"icon": "fa fa-user"
},
{
"label": "Nav 2",
"to": "/docs/api"
},
{
"label": "Nav 3",
"to": "/docs/renderers"
}
]
}
}
```