mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-14 20:03:09 +02:00
27 lines
424 B
Vue
27 lines
424 B
Vue
|
<template>
|
||
|
<span v-html="compiledFormula"></span>
|
||
|
</template>
|
||
|
|
||
|
<script lang="ts">
|
||
|
import Vue from 'vue';
|
||
|
import * as katex from 'katex';
|
||
|
|
||
|
export default Vue.extend({
|
||
|
props: {
|
||
|
formula: {
|
||
|
type: String,
|
||
|
required: true
|
||
|
}
|
||
|
},
|
||
|
computed: {
|
||
|
compiledFormula(): any {
|
||
|
return katex.renderToString(this.formula);
|
||
|
}
|
||
|
}
|
||
|
});
|
||
|
</script>
|
||
|
|
||
|
<style>
|
||
|
@import "../../../../../../node_modules/katex/dist/katex.min.css";
|
||
|
</style>
|