[BugFix] 修复了在非章节化作品时仍判断为章节作品的 BUG
All checks were successful
Build / build-and-test (push) Successful in 26s

This commit is contained in:
2025-05-28 13:58:09 +08:00
parent 51b20c860f
commit eda629e58d

View File

@ -56,7 +56,7 @@ onMounted(async () => {
if (workReadState.state != 'ssrnotfound') await workReadState.loadWork(route.params.id, route.params.cid)
if (workReadState.state == 'ready') {
routeState.customTitle = workReadState.title
if (parseInt(route.params.cid) != workReadState.cid) {
if (workReadState.cid !== null && parseInt(route.params.cid) != workReadState.cid) {
router.replace(`/work/${workReadState.id}/${workReadState.cid}`)
return;
}
@ -89,7 +89,6 @@ onMounted(async () => {
paragraphs = content.value?.querySelectorAll('p');
paragraphs?.forEach(p => isObserver.observe(p));
}
console.log(workReadState.chapterStat)
})
onBeforeUnmount(() => {
@ -163,7 +162,7 @@ async function switchWorkWithIndex(target) {
</dd></template>
</dl>
</mdui-card>
<template v-if="workReadState.chapters">
<template v-if="workReadState.cid">
<p> {{ workReadState.chapterIndex + 1 }} / {{ workReadState.chapters.length }} : {{ workReadState.chapters[workReadState.chapterIndex].title }}</p>
<mdui-button variant='filled' @click="chapterDialog.open = true">章节列表</mdui-button>
</template>
@ -174,7 +173,7 @@ async function switchWorkWithIndex(target) {
<p v-for="(para, index) in workReadState.text" :key="para" :data-index="index">{{ para }}</p>
</article>
</article><Hr/>
<p style="display: flex;" v-if="workReadState.chapters">
<p style="display: flex;" v-if="workReadState.cid">
<mdui-button variant="filled" v-if="workReadState.chapterIndex != 0" @click="switchWorkWithIndex(workReadState.chapterIndex - 1)">上一章</mdui-button>
<span style="flex: 1;"/>
{{ workReadState.chapterIndex + 1 }} / {{ workReadState.chapters.length }}