diff --git a/src/components/dialog/DictDiglog.vue b/src/components/dialog/DictDiglog.vue
index eba0a241..6d4495f0 100644
--- a/src/components/dialog/DictDiglog.vue
+++ b/src/components/dialog/DictDiglog.vue
@@ -398,7 +398,7 @@ function delWord(word: Word, index: number) {
}
}
- runtimeStore.editDict.words.splice(DictDiglog, 1)
+ runtimeStore.editDict.words.splice(index, 1)
wordList = cloneDeep(runtimeStore.editDict.words)
syncMyDictList()
@@ -437,6 +437,16 @@ function add() {
/* 单词修改相关*/
/**/
+
+/**/
+/* 文章修改相关*/
+/**/
+
+function delChapter(index: number) {
+ runtimeStore.editDict.articles.splice(index, 1)
+ syncMyDictList()
+}
+
watch(() => step, v => {
if (v === 0) {
closeWordForm()
@@ -717,6 +727,7 @@ onMounted(() => {
v-if="chapterList"
v-loading="loading"
:is-article="dictIsArticle"
+ @del="delChapter"
v-model:active-index="runtimeStore.editDict.chapterIndex"
:dict="runtimeStore.editDict"/>
diff --git a/src/components/list/ChapterList.vue b/src/components/list/ChapterList.vue
index c7661bef..c0a936b3 100644
--- a/src/components/list/ChapterList.vue
+++ b/src/components/list/ChapterList.vue
@@ -4,6 +4,7 @@ import {Dict, Word} from "@/types.ts"
import {emitter, EventKey} from "@/utils/eventBus.ts";
import {$computed} from "vue/macros";
import {useRuntimeStore} from "@/stores/runtime.ts";
+import BaseIcon from "@/components/BaseIcon.vue";
const props = defineProps<{
dict: Dict,
@@ -13,6 +14,7 @@ const props = defineProps<{
const emit = defineEmits<{
'update:activeIndex': [index: number]
+ del: [index: number]
}>()
const runtimeStore = useRuntimeStore()
@@ -40,21 +42,28 @@ function showWordListModal(index: number, item: Word[]) {
@click="emit('update:activeIndex', index)">
-
-
-
+
+ {{ index + 1 }}. {{ item.title }}
+ >{{ index + 1 }}. {{ item.title }}
{{ item.titleTranslate }}
-
-
-
- 第{{ index + 1 }}章 {{ item.length }}词
-
-
+
+
+ 第{{ index + 1 }}章 {{ item.length }}词
+
+
+
+
+
+
@@ -76,21 +85,30 @@ function showWordListModal(index: number, item: Word[]) {
.common-list-item {
- &:hover {
- .title {
- border-bottom: 2px solid gray !important;
- }
- }
-
input {
cursor: pointer;
}
- .title {
+ .item-title {
transition: all .3s;
cursor: pointer;
border-bottom: 2px solid transparent;
}
+
+ :deep(.del) {
+ opacity: 0;
+ }
+
+ &:hover {
+ .item-title {
+ border-bottom: 2px solid gray !important;
+ }
+
+ :deep(.del) {
+ opacity: 1;
+ }
+ }
+
}
}
\ No newline at end of file