mirror of
https://github.com/gedoor/legado.git
synced 2024-09-01 09:34:25 +08:00
web: 修复快捷键设置bug和esc键逻辑; 修复超大章节列表造成的卡顿
bug: 第一点击目录时没有跳转到合适位置
This commit is contained in:
parent
ec9c2fec08
commit
9447bef57b
35
modules/web/src/components/CatalogItem.vue
Normal file
35
modules/web/src/components/CatalogItem.vue
Normal file
@ -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>
|
Loading…
Reference in New Issue
Block a user