This commit is contained in:
Zyronon
2025-12-19 18:59:39 +08:00
committed by GitHub
parent eba448dbd5
commit d9ee131e3d
7 changed files with 17 additions and 30 deletions

View File

@@ -45,7 +45,7 @@ const {
<slot name="prefix" :item="item"></slot>
<div class="title-wrapper">
<div class="item-title">
<span class="text-sm translate-y-0.7 text-gray-500" v-if="index != undefined">{{ index }}.</span>
<span class="text-sm translate-y-0.5 text-gray-500" v-if="index != undefined">{{ index }}.</span>
<span class="word" :class="!showWord && 'word-shadow'">{{ item.word }}</span>
<span class="phonetic text-gray">{{ item.phonetic0 }}</span>
<VolumeIcon class="volume" @click="playWordAudio(item.word)"></VolumeIcon>

View File

@@ -107,7 +107,7 @@ defineExpose({ scrollToBottom, scrollToItem })
<IconFluentStar16Regular v-if="!isArticleCollect(item)" />
<IconFluentStar16Filled v-else />
</BaseIcon>
<BaseIcon title="可播放音频" v-if="item.audioSrc || item.audioFileId">
<BaseIcon title="可播放音频" v-if="item.audioSrc || item.audioFileId" noBg>
<IconBxVolumeFull class="opacity-100! color-gray" />
</BaseIcon>
</div>

View File

@@ -46,7 +46,7 @@ function scrollViewToCenter(index: number) {
if (props.list.length > limit) {
listRef?.scrollToItem(index)
} else {
listRef?.children[index]?.scrollIntoView({ block: 'center', behavior: 'smooth' })
listRef?.children[index]?.scrollIntoView({block: 'center', behavior: 'smooth'})
}
})
}
@@ -59,7 +59,7 @@ watch(
scrollViewToCenter(n)
}
},
{ immediate: true }
{immediate: true}
)
watch(
@@ -101,7 +101,7 @@ function scrollToItem(index: number) {
if (props.list.length > limit) {
listRef?.scrollToItem(index)
} else {
listRef?.children[index]?.scrollIntoView({ block: 'center', behavior: 'smooth' })
listRef?.children[index]?.scrollIntoView({block: 'center', behavior: 'smooth'})
}
})
}
@@ -110,7 +110,7 @@ function itemIsActive(item: any, index: number) {
return props.activeId ? props.activeId == item.id : props.activeIndex === index
}
defineExpose({ scrollToBottom, scrollToItem })
defineExpose({scrollToBottom, scrollToItem})
</script>
<template>
@@ -128,19 +128,18 @@ defineExpose({ scrollToBottom, scrollToItem })
:size-dependencies="[item.id]"
:data-index="index"
>
<div class="list-item-wrapper" v-for="(item, index) in props.list" :key="item.title">
<div @click="emit('click', { item, index })">
<slot :item="item" :index="index" :active="itemIsActive(item, index)"></slot>
</div>
<div class="list-item-wrapper"
@click="emit('click', { item, index })">
<slot :item="item" :index="index+1" :active="itemIsActive(item, index)"></slot>
</div>
</DynamicScrollerItem>
</template>
</DynamicScroller>
<div v-else class="scroller" style="overflow: auto" ref="listRef">
<div class="list-item-wrapper" v-for="(item, index) in props.list" :key="item.title">
<div @click="emit('click', { item, index })">
<slot :item="item" :index="index" :active="itemIsActive(item, index)"></slot>
</div>
<div class="list-item-wrapper" v-for="(item, index) in props.list" :key="item.title"
@click="emit('click', { item, index })"
>
<slot :item="item" :index="index+1" :active="itemIsActive(item, index)"></slot>
</div>
</div>
</template>

View File

@@ -211,19 +211,6 @@ function next() {
@click="handleCheckedChange"
:list="runtimeStore.editDict.articles"
:active-id="selectArticle.id">
<template v-slot:suffix="{item,index}">
<BaseIcon
:class="!isArticleCollect(item)?'collect':'fill'"
@click.stop="toggleArticleCollect(item)"
:title="!isArticleCollect(item) ? '收藏' : '取消收藏'">
<IconFluentStar16Regular v-if="!isArticleCollect(item)"/>
<IconFluentStar16Filled v-else/>
</BaseIcon>
<BaseIcon title="可播放音频" v-if="item.audioSrc || item.audioFileId">
<IconBxVolumeFull class="opacity-100!"/>
</BaseIcon>
</template>
</ArticleList>
<Empty v-else/>
</div>

View File

@@ -453,7 +453,7 @@ function onTypeWrong() {
}
function savePracticeData() {
console.log('savePracticeData')
// console.log('savePracticeData')
localStorage.setItem(PracticeSaveWordKey.key, JSON.stringify({
version: PracticeSaveWordKey.version,
val: {

View File

@@ -41,7 +41,7 @@ defineEmits<{
>
<template v-slot="item">
<WordItem
@click="$emit('ok',item.index)"
@click="$emit('ok',item.index-1)"
:item="item.item"
:show-translate="false"
:index="item.index"