mirror of
https://github.com/kokonect-link/cherrypick
synced 2024-12-12 21:58:58 +09:00
tweak 1ad9b748
This commit is contained in:
parent
57c5c4b4de
commit
38254c1c2a
@ -1,23 +0,0 @@
|
||||
<template>
|
||||
<XFormula :formula="formula" :block="block"/>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent, defineAsyncComponent } from 'vue';
|
||||
|
||||
export default defineComponent({
|
||||
components: {
|
||||
XFormula: defineAsyncComponent(() => import('@/components/MkFormulaCore.vue')),
|
||||
},
|
||||
props: {
|
||||
formula: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
block: {
|
||||
type: Boolean,
|
||||
required: true,
|
||||
},
|
||||
},
|
||||
});
|
||||
</script>
|
@ -1,34 +0,0 @@
|
||||
<!-- eslint-disable vue/no-v-html -->
|
||||
<template>
|
||||
<div v-if="block" v-html="compiledFormula"></div>
|
||||
<span v-else v-html="compiledFormula"></span>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent } from 'vue';
|
||||
import temml from '../../node_modules/temml/dist/temml.cjs';
|
||||
|
||||
export default defineComponent({
|
||||
props: {
|
||||
formula: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
block: {
|
||||
type: Boolean,
|
||||
required: true,
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
compiledFormula(): any {
|
||||
return temml.renderToString(this.formula, {
|
||||
throwOnError: false,
|
||||
} as any);
|
||||
},
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
||||
<style>
|
||||
@import "../../node_modules/temml/dist/Temml-Local.css";
|
||||
</style>
|
Loading…
Reference in New Issue
Block a user