提交 5c5d8cb0 编写于 作者: D DebugIsFalse

Update ProsePre.global.vue

上级 94ef6534
...@@ -54,10 +54,9 @@ const handleCopy = () => { ...@@ -54,10 +54,9 @@ const handleCopy = () => {
} }
const codeBlock = ref(null) const codeBlock = ref(null)
const handleRender = () => { const handleRender = () => {
if (props.language) { const language = props.language || 'html';
const lang = props.language === 'vue' ? 'html' : props.language const lang = language.startsWith('vue') ? 'html' : language
codeBlock.value = hljs.highlight(lang, props.code, true).value codeBlock.value = hljs.highlight(lang, props.code, true).value
}
} }
watch(()=> props.code, () => { watch(()=> props.code, () => {
handleRender(); handleRender();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册