[skip ci] perf(web): improve little performance

This commit is contained in:
Xwite committed 2023-05-14 14:06:18 +08:00
1 parent 1109d54779
commit e173e3196d
7 files changed
+39 -38

No files matched your search

+2 -7
View File
@@ -12,17 +12,12 @@
</div>
</template>
<script setup>
const props = defineProps(["index", "source", "gotoChapter"]);
const store = useBookStore();
const index = computed(() => store.readingBook.index);
const props = defineProps(["index", "source", "gotoChapter", "currentChapterIndex"]);
const isSelected = (idx) => {
return idx == index.value;
return idx == props.currentChapterIndex;
};
// 处理pc mobile
const catas = computed(() => {
return props.source?.catas ?? [props.source];
});