Created
January 18, 2019 14:33
-
-
Save bmorrisondev/9787052b38ebad4e9e6fe8fbdfc7ec35 to your computer and use it in GitHub Desktop.
A VueJS template to display formatted code on a page using PrismJS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div> | |
<prism language="json" :code="JSON.stringify(data, null, 4)"></prism> | |
</div> | |
</template> | |
<script> | |
import Prism from 'vue-prismjs' | |
import 'prismjs/themes/prism.css' | |
export default { | |
name: 'PrismView', | |
components: { | |
Prism | |
}, | |
data: function() { | |
return { | |
data: Object | |
} | |
} | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment