Theme updated
This commit is contained in:
16
src/layout/CodeHighlight.js
Normal file
16
src/layout/CodeHighlight.js
Normal file
@@ -0,0 +1,16 @@
|
||||
import Prism from 'prismjs';
|
||||
|
||||
const CodeHighlight = {
|
||||
beforeMount (el, binding) {
|
||||
const modifiers = binding.modifiers;
|
||||
const value = binding.value;
|
||||
|
||||
if (modifiers.script || value === 'script') el.className = 'language-javascript';
|
||||
else if (modifiers.css || value === 'css') el.className = 'language-css';
|
||||
else el.className = 'language-markup';
|
||||
|
||||
Prism.highlightElement(el.children[0]);
|
||||
}
|
||||
};
|
||||
|
||||
export default CodeHighlight;
|
||||
Reference in New Issue
Block a user