2018-11-16 00:03:52 -08:00
|
|
|
<template>
|
|
|
|
<span v-html="compiledFormula"></span>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
|
|
import Vue from 'vue';
|
2018-11-16 01:26:19 -08:00
|
|
|
import * as katex from 'katex';
|
2018-11-16 00:03:52 -08:00
|
|
|
|
|
|
|
export default Vue.extend({
|
|
|
|
props: {
|
|
|
|
formula: {
|
|
|
|
type: String,
|
|
|
|
required: true
|
|
|
|
}
|
|
|
|
},
|
2018-11-16 01:26:19 -08:00
|
|
|
computed: {
|
|
|
|
compiledFormula(): any {
|
|
|
|
return katex.renderToString(this.formula);
|
|
|
|
}
|
2018-11-16 00:03:52 -08:00
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style>
|
|
|
|
@import "../../../../../../node_modules/katex/dist/katex.min.css";
|
|
|
|
</style>
|