This commit is contained in:
07akioni 2020-02-01 16:45:11 +08:00
parent 040127220c
commit 668c6b49fd
2 changed files with 24 additions and 2 deletions

View File

@ -14,7 +14,7 @@ Log has `require-more`, `reach-top` and `reach-bottom` event. Note that even if
```js
function log () {
const l = []
for (let i = 0; i < 40; ++i) {
for (let i = 0; i < 10; ++i) {
l.push((Math.random()).toString(16))
}
return l.join('\n') + '\n'

View File

@ -1,5 +1,7 @@
# Log
<!--single-column-->
If you have some logs to show, use log.
<n-alert title="Note" type="warning">
Due to package size, Naive UI doesn't include highlight.js. If you want highlight logs, make sure you have set highlightjs before using it.
</n-alert>
@ -29,4 +31,24 @@ event
scroll
highlight
loading
```
```
## Props
|Name|Type|Default|Description|
|-|-|-|-|
|loading|`boolean`|`false`||
|trim|`boolean`|`false`||
|log|`string`|`null`||
|lines|`Array<string>`|`null`||
|font-size|`number`|`14`||
|line-height|`number`|`1.25`||
|language|`string`|`null`||
|rows|`number`|`15`||
|hljs|`object`|`null`||
## Events
|Name|Parameters|Description|
|-|-|-|
|require-more|`(from: 'top' \| 'bottom')`||
|reach-top|`()`|
|reach-bottom|`()`|