File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed
Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change 7272 :style =" preTagStyles"
7373 >
7474<code
75+ v-if =" prismPlugin"
7576 :class =" `language-${props.lang} ${browserWindow ? 'v-code-block--code-browser' : ''} ${highlightjs ? 'hljs' : ''}`"
7677 :style =" codeTagStyles"
77- v-html =" !prismPlugin ? renderedCode : false"
78- v-text =" prismPlugin ? computedCode : false"
78+ v-text =" computedCode"
79+ ></code >
80+ <code
81+ v-else
82+ :class =" `language-${props.lang} ${browserWindow ? 'v-code-block--code-browser' : ''} ${highlightjs ? 'hljs' : ''}`"
83+ :style =" codeTagStyles"
84+ v-html =" renderedCode"
7985></code >
8086 </pre >
8187 </div >
@@ -203,7 +209,7 @@ const props = defineProps({
203209 prismjs: {
204210 type: Boolean ,
205211 required: false ,
206- default: true ,
212+ default: false ,
207213 },
208214 prismPlugin: {
209215 type: Boolean ,
@@ -399,6 +405,10 @@ onMounted(() => {
399405
400406// -------------------------------------------------- Methods //
401407function checkLibrary(): void {
408+ if (! props .prismjs && ! props .highlightjs ) {
409+ throw new Error (' [vue3-code-block]: You must set either the prismjs or highlightjs props.' );
410+ }
411+
402412 if (props .prismjs && props .highlightjs ) {
403413 throw new Error (' [vue3-code-block]: You cannot have both prismjs and highlightjs props set at the same time.' );
404414 }
You can’t perform that action at this time.
0 commit comments