2022-03-18 20:36:05 +08:00
|
|
|
import hljs from 'highlight.js/lib/core'
|
|
|
|
import json from 'highlight.js/lib/languages/json'
|
|
|
|
import typescript from 'highlight.js/lib/languages/typescript'
|
|
|
|
|
2022-03-24 14:19:07 +08:00
|
|
|
// * code 展示
|
2022-03-22 11:41:43 +08:00
|
|
|
export const useCode = () => {
|
2022-03-18 20:36:05 +08:00
|
|
|
hljs.registerLanguage('json', json)
|
|
|
|
hljs.registerLanguage('typescript', typescript)
|
|
|
|
return hljs
|
|
|
|
}
|