提交 947d4b9a 编写于 作者: View Design's avatar View Design

使用 hljs 新 API

上级 e8967b9b
......@@ -63,7 +63,7 @@ const codeBlock = ref(null)
const handleRender = () => {
const language = props.language || 'html'
const lang = language.startsWith('vue') ? 'html' : language
codeBlock.value = hljs.highlight(lang, props.code, true).value
codeBlock.value = hljs.highlight(props.code, { language: lang }).value
}
watch(()=> props.code, () => {
handleRender();
......
<template>
to be done
</template>
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册