web: 修复快捷键设置bug和esc键逻辑; 修复超大章节列表造成的卡顿
bug: 第一点击目录时没有跳转到合适位置
This commit is contained in:
@@ -0,0 +1,35 @@
|
|||||||
|
<template>
|
||||||
|
<div
|
||||||
|
class="cata-text"
|
||||||
|
:class="{ selected: isSelected(source.index) }"
|
||||||
|
@click="gotoChapter(source)"
|
||||||
|
>
|
||||||
|
{{ source.title }}
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script setup>
|
||||||
|
defineProps(["index", "source", "gotoChapter"]);
|
||||||
|
|
||||||
|
const store = useBookStore();
|
||||||
|
|
||||||
|
const { catalog } = storeToRefs(store);
|
||||||
|
|
||||||
|
const index = computed(() => store.readingBook.index);
|
||||||
|
|
||||||
|
const isSelected = (idx) => {
|
||||||
|
return idx == index.value;
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.selected {
|
||||||
|
color: #eb4259;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cata-text {
|
||||||
|
margin-right: 26px;
|
||||||
|
overflow: hidden;
|
||||||
|
white-space: nowrap;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
Reference in New Issue
Block a user