fix lint errors in SkFormula.vue
This commit is contained in:
parent
2bd87fa481
commit
5f3cb09eb1
3 changed files with 56 additions and 46 deletions
|
|
@ -98,6 +98,7 @@
|
|||
"@storybook/vue3-vite": "8.3.3",
|
||||
"@testing-library/vue": "8.1.0",
|
||||
"@types/estree": "1.0.6",
|
||||
"@types/katex": "^0.16.7",
|
||||
"@types/matter-js": "0.19.7",
|
||||
"@types/micromatch": "4.0.9",
|
||||
"@types/node": "20.14.12",
|
||||
|
|
|
|||
|
|
@ -4,26 +4,26 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
-->
|
||||
|
||||
<template>
|
||||
<div v-if="block" :class="$style.block" v-html="renderedFormula"></div>
|
||||
<span v-else v-html="renderedFormula"></span>
|
||||
<div v-if="block" :class="$style.block" v-html="renderedFormula"></div>
|
||||
<span v-else v-html="renderedFormula"></span>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { computed } from 'vue';
|
||||
import katex from 'katex';
|
||||
import 'katex/dist/katex.min.css';
|
||||
import { computed } from 'vue';
|
||||
import katex from 'katex';
|
||||
import 'katex/dist/katex.min.css';
|
||||
|
||||
const props = defineProps<{
|
||||
const props = defineProps<{
|
||||
formula: string;
|
||||
block: boolean;
|
||||
}>();
|
||||
|
||||
const renderedFormula = computed(() =>
|
||||
katex.renderToString(props.formula, {
|
||||
throwOnError: false,
|
||||
trust: false,
|
||||
displayMode: props.block,
|
||||
} as any));
|
||||
const renderedFormula = computed(() =>
|
||||
katex.renderToString(props.formula, {
|
||||
throwOnError: false,
|
||||
trust: false,
|
||||
displayMode: props.block,
|
||||
}));
|
||||
</script>
|
||||
|
||||
<style lang="scss" module>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue