diff --git a/src/views/ProjectView.vue b/src/views/ProjectView.vue index 6dc81c4..2eeb921 100644 --- a/src/views/ProjectView.vue +++ b/src/views/ProjectView.vue @@ -1,34 +1,64 @@ @@ -50,16 +80,19 @@ import { // --- 文档面板控制 --- const showDocPanel = ref(false); -const documentContent = ref(''); +const documentContent = ref(""); // 切换文档面板和属性面板 async function toggleDocPanel() { showDocPanel.value = !showDocPanel.value; - + // 如果切换到文档面板,则获取文档内容 if (showDocPanel.value) { - const response = await fetch("/public/doc/01_water_led/water_led.md"); - documentContent.value = await response.text(); + const response = await fetch("/doc/01_water_led/water_led.md"); + documentContent.value = (await response.text()).replace( + /.\/images/gi, + "/doc/01_water_led/images", + ); } } @@ -791,6 +824,6 @@ body { padding: 1rem; background-color: hsl(var(--b1)); border-radius: 0.5rem; - box-shadow: 0 1px 3px rgba(0,0,0,0.1); + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); }