Merge remote-tracking branch 'baidu/master'

This commit is contained in:
2betop 2020-10-20 17:24:16 +08:00
commit 3ef8d161bd
2 changed files with 51 additions and 10 deletions

View File

@ -189,10 +189,10 @@ List 的内容、Card 卡片的内容配置同上
## 属性表
| 属性名 | 类型 | 默认值 | 说明 |
| ----------- | --------- | ---------- | ------------------------------------------------------------------------------------ |
| ----------- | ----------------- | ---------- | ------------------------------------------------------------------------------------ |
| type | `string` | | 如果在 Table、Card 和 List 中,为`"json"`;在 Form 中用作静态展示,为`"static-json"` |
| className | `string` | | 外层 CSS 类名 |
| value | `object` | | json 值 |
| value | `object`/`string` | | json 值,如果是 string 会自动 parse |
| source | `string` | `''` | 通过数据映射获取数据链中的值 |
| placeholder | `string` | `-` | 占位文本 |
| levelExpand | `number` | `1` | 默认展开的层级 |

View File

@ -994,6 +994,47 @@ ${xxx | duration}
}
```
### bytes
字节格式化展示
##### 基本用法
```
${xxx | bytes}
```
```schema:height="200"
{
"type": "page",
"data": {
"bytes1": 2333,
"bytes2": 2333333,
"bytes3": 2333333333
},
"body": [
{
"type": "tpl",
"tpl": "bytes1 is ${bytes1|bytes}"
},
{
"type": "divider"
},
{
"type": "tpl",
"tpl": "bytes2 is ${bytes2|bytes}"
},
{
"type": "divider"
},
{
"type": "tpl",
"tpl": "bytes3 is ${bytes3|bytes}"
}
]
}
```
### asArray
将数据包成数组