mirror of
https://iceshrimp.dev/crimekillz/trashposs
synced 2024-11-24 01:39:06 +01:00
e24ca1e51f
Co-authored-by: MeiMei <30769358+mei23@users.noreply.github.com> Co-authored-by: Satsuki Yanagi <17376330+u1-liquid@users.noreply.github.com>
34 lines
563 B
Vue
34 lines
563 B
Vue
|
|
<template>
|
|
<div v-if="block" v-html="compiledFormula"></div>
|
|
<span v-else 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
|
|
},
|
|
block: {
|
|
type: Boolean,
|
|
required: true
|
|
}
|
|
},
|
|
computed: {
|
|
compiledFormula(): any {
|
|
return katex.renderToString(this.formula, {
|
|
throwOnError: false
|
|
} as any);
|
|
}
|
|
}
|
|
});
|
|
</script>
|
|
|
|
<style>
|
|
@import "../../../node_modules/katex/dist/katex.min.css";
|
|
</style>
|