From dce79ef27d1cbccc12046518cab7c8b78a97024c Mon Sep 17 00:00:00 2001 From: yuetsh <517252939@qq.com> Date: Tue, 4 Mar 2025 20:38:05 +0800 Subject: [PATCH] fix --- src/components/Tutorial.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/Tutorial.vue b/src/components/Tutorial.vue index 44b1be9..55f0d19 100644 --- a/src/components/Tutorial.vue +++ b/src/components/Tutorial.vue @@ -31,7 +31,7 @@ const $content = useTemplateRef("$content") const prevDisabled = computed(() => { const i = displays.value.indexOf(step.value) - return i === 0 + return i <= 0 }) const nextDisabled = computed(() => { const i = displays.value.indexOf(step.value) @@ -51,6 +51,10 @@ function next() { async function getContent() { const res = await Tutorial.listDisplay() displays.value = res + if (!displays.value.length) { + content.value = "暂无教程" + return + } if (!displays.value.includes(step.value)) { step.value = displays.value[0] }