mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2024-12-27 05:00:48 +08:00
487001d697
.demo.md for component demo .demo-entry.md for demo entry .md for common docs
1.5 KiB
1.5 KiB
Log
If you have some logs to show, use log.
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.In hightlight demo, we defined a language called naive-log
which will highlight all the numbers of line. The following code shows how we defined it. If you want to know more about hightlight.js, see hightlight.js and highlight.js developer documentation
...
hljs.registerLanguage('naive-log', () => ({
contains: [
{
className: 'number',
begin: /\d+/
}
]
}))
Vue.use(NaiveUI)
NaiveUI.setHljs(hljs)
...
Demos
size
event
scroll
highlight
loading
Props
Name | Type | Default | Description |
---|---|---|---|
theme | 'light' | 'dark' | null |
null |
|
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 | () |
Methods
Name | Parameters | Description |
---|---|---|
scrollToTop | (dismissEvent: boolean = false) |
|
scrollToBottom | (dismissEvent: boolean = false) |