mirror of
https://iceshrimp.dev/iceshrimp/iceshrimp
synced 2024-12-19 17:18:12 +09:00
30 lines
497 B
Vue
30 lines
497 B
Vue
<template>
|
|
<span v-html="compiledFormula"></span>
|
|
</template>
|
|
|
|
<script lang="ts">
|
|
import Vue from 'vue';
|
|
|
|
export default Vue.extend({
|
|
props: {
|
|
formula: {
|
|
type: String,
|
|
required: true
|
|
}
|
|
},
|
|
data() {
|
|
return {
|
|
compiledFormula: null
|
|
};
|
|
},
|
|
async created() {
|
|
const katex = await import('katex').then(m => m.default);
|
|
this.compiledFormula = katex.renderToString(this.formula);
|
|
}
|
|
});
|
|
</script>
|
|
|
|
<style>
|
|
@import "../../../../../../node_modules/katex/dist/katex.min.css";
|
|
</style>
|