mirror of
https://github.com/primefaces/primevue.git
synced 2025-05-10 01:12:37 +00:00
Update doc components structure
This commit is contained in:
parent
cf5dd67244
commit
036b90fc82
16 changed files with 18 additions and 14 deletions
16
components/layout/CodeHighlight.js
Normal file
16
components/layout/CodeHighlight.js
Normal file
|
@ -0,0 +1,16 @@
|
|||
import { DomHandler } from 'primevue/utils';
|
||||
|
||||
const CodeHighlight = {
|
||||
mounted(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';
|
||||
|
||||
DomHandler.isClient() && window.Prism.highlightElement(el.children[0]);
|
||||
}
|
||||
};
|
||||
|
||||
export default CodeHighlight;
|
Loading…
Add table
Add a link
Reference in a new issue