You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ui/src/components/Katex.vue

30 lines
686 B

<script setup lang="ts">
import {HTMLString} from '../types'
import {computed} from 'vue'
import {MathStatement} from '../support/parse'
const props = defineProps<{
statement: MathStatement,
size?: 'big' | 'small',
}>()
let displayHtml: HTMLString = props.statement.toHTMLString()
computed(() => displayHtml = props.statement.toHTMLString())
</script>
<style>
.big {
transform: scale(1.3);
}
.small {
transform: scale(0.9);
}
</style>
<template>
<div class="big" v-if="props?.size === 'big'" v-html="displayHtml"></div>
<div class="small" v-else-if="props?.size === 'small'" v-html="displayHtml"></div>
<div v-else v-html="displayHtml"></div>
</template>