Refonte inventaire et objets #236

Merged
kazhnuz merged 27 commits from inventaire into master 2023-02-18 19:06:28 +01:00
Showing only changes of commit dafd9fe325 - Show all commits

View file

@ -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>