naive-ui/demo/documentation/components/log/enUS/index.md
2019-12-22 16:10:18 +08:00

832 B

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