fix: correction d'une regression sur le render
This commit is contained in:
parent
2ff9638f49
commit
dafd9fe325
1 changed files with 12 additions and 1 deletions
|
@ -1,5 +1,5 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, onMounted, onBeforeUpdate } from "vue";
|
import { ref, onMounted, onBeforeUpdate, watch } from "vue";
|
||||||
import { marked } from "marked";
|
import { marked } from "marked";
|
||||||
import { useTocStore } from "../../stores/toc";
|
import { useTocStore } from "../../stores/toc";
|
||||||
|
|
||||||
|
@ -94,6 +94,10 @@ function render() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function forceRender(markdown: string) {
|
||||||
|
htmlContent.value = marked.parse(markdown);
|
||||||
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
render();
|
render();
|
||||||
});
|
});
|
||||||
|
@ -101,6 +105,13 @@ onMounted(() => {
|
||||||
onBeforeUpdate(() => {
|
onBeforeUpdate(() => {
|
||||||
render();
|
render();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => props.markdown,
|
||||||
|
(newMd) => {
|
||||||
|
forceRender(newMd);
|
||||||
|
}
|
||||||
|
);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|
Loading…
Reference in a new issue