fix(ranking): show list counts in card headers

This commit is contained in:
digua committed 2026-07-16 23:28:17 +08:00
1 parent abd7027d38
commit d75793c5ca
3 files changed
+4 -7

No files matched your search

@@ -66,7 +66,7 @@ watch(
:title="t('quotes.hotRepeat.title')"
:description="t('quotes.hotRepeat.description')"
:top-n="10"
:count-template="t('quotes.hotRepeat.countTemplate')"
:count-label="t('quotes.hotRepeat.countTemplate', { count: repeatAnalysis.hotContents.length })"
>
<template #item="{ item, index }">
<button
@@ -373,7 +373,7 @@ watch(
:title="t('quotes.keywords.title')"
:description="t('quotes.keywords.description')"
:top-n="10"
:count-template="t('quotes.keywords.countTemplate')"
:count-label="t('quotes.keywords.countTemplate', { count: rankData.length })"
>
<!-- 配置区 -->
<template #config>
+2 -5
View File
@@ -15,9 +15,7 @@ const props = withDefaults(
description?: string
/** 默认显示数量,默认 10 */
topN?: number
/** 弹窗中的总数描述模板,如 "共 {count} 位成员" */
countTemplate?: string
/** 已完成国际化插值的总数描述,优先于 countTemplate */
/** 已完成国际化插值的总数描述 */
countLabel?: string
}>(),
{
@@ -34,8 +32,7 @@ const showViewAll = computed(() => props.items.length > props.topN)
// 格式化总数描述
const formattedCount = computed(() => {
if (props.countLabel) return props.countLabel
const template = props.countTemplate || t('views.charts.listPro.countTemplate')
return template.replace('{count}', String(props.items.length))
return t('views.charts.listPro.countTemplate', { count: props.items.length })
})
</script>