diff --git a/src/components/editor/Preview.vue b/src/components/editor/Preview.vue index 683ff31..8a8ac2c 100644 --- a/src/components/editor/Preview.vue +++ b/src/components/editor/Preview.vue @@ -91,12 +91,12 @@ const layoutConfig: Record< }, } const layoutIndex = ref(0) -const layoutIcon = computed(() => layoutConfig[layouts[layoutIndex.value]].icon) +const layoutIcon = computed(() => layoutConfig[layouts[layoutIndex.value]!].icon) const layoutLabel = computed( - () => layoutConfig[layouts[layoutIndex.value]].label, + () => layoutConfig[layouts[layoutIndex.value]!].label, ) const iframeWrapperStyle = computed(() => ({ - maxWidth: layoutConfig[layouts[layoutIndex.value]].width, + maxWidth: layoutConfig[layouts[layoutIndex.value]!].width, })) function cycleLayout() { layoutIndex.value = (layoutIndex.value + 1) % layouts.length diff --git a/src/pages/TutorialEditor.vue b/src/pages/TutorialEditor.vue index 8cd600a..ebe8805 100644 --- a/src/pages/TutorialEditor.vue +++ b/src/pages/TutorialEditor.vue @@ -104,7 +104,7 @@ async function getContent() { if (target) { show(display) } else if (list.value.length > 0) { - show(list.value[0].display) + show(list.value[0]!.display) } }