2019-01-27 06:34:52 +01:00
|
|
|
<template>
|
2019-01-27 12:05:03 +01:00
|
|
|
<prism :inline="inline" :language="lang || 'js'">{{ code }}</prism>
|
2019-01-27 06:34:52 +01:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
|
|
import Vue from 'vue';
|
|
|
|
import 'prismjs';
|
2019-01-27 12:03:58 +01:00
|
|
|
import 'prismjs/themes/prism-okaidia.css';
|
2019-01-27 06:34:52 +01:00
|
|
|
import Prism from 'vue-prism-component';
|
|
|
|
|
|
|
|
export default Vue.extend({
|
|
|
|
components: {
|
|
|
|
Prism
|
|
|
|
},
|
|
|
|
props: {
|
|
|
|
code: {
|
|
|
|
type: String,
|
|
|
|
required: true
|
|
|
|
},
|
|
|
|
lang: {
|
|
|
|
type: String,
|
|
|
|
required: false
|
|
|
|
},
|
|
|
|
inline: {
|
|
|
|
type: Boolean,
|
|
|
|
required: false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|