This commit is contained in:
2026-05-28 00:30:56 +08:00
parent e834912f2c
commit 031c8c1cc7
4 changed files with 365 additions and 332 deletions
@@ -25,9 +25,7 @@ const basic = computed(() => {
},
{
label: "施放时间",
value: !info.attribute.castingTime
? "瞬发"
: `${info.attribute.castingTime.toFixed(1)}秒`,
value: !info.attribute.castingTime ? "瞬发" : `${info.attribute.castingTime.toFixed(1)}秒`,
},
{ label: "魔法值", value: info.attribute.consumeMp },
{
@@ -40,8 +38,7 @@ const basic = computed(() => {
const descLines = computed(() => skillInfo.value?.descDetail.split("\n") ?? []);
const detailLines = computed(() => {
const items =
skillInfo.value?.attribute.optionDesc?.split("\n").filter((item) => !!item) ?? [];
const items = skillInfo.value?.attribute.optionDesc?.split("\n").filter((item) => !!item) ?? [];
return items.map((a) => {
// highlight value placeholder prefix
const beforeReplace = a.match(/^(.+?)\s*(\{value\d+\}.*)$/);
@@ -53,8 +50,7 @@ const detailLines = computed(() => {
matches.forEach((match) => {
const key = match.replace(/[{}]/g, "");
if (/^value.+/.test(key)) {
const value =
skillInfo.value?.attribute.optionValue[key as `value${string}`] ?? "-";
const value = skillInfo.value?.attribute.optionValue[key as `value${string}`] ?? "-";
a = a.replace(
match,
`<span style="padding:0 2px;color:var(--color-skill-value,#4AA256)">${value}</span>`,
@@ -70,7 +66,10 @@ const hasEvolution = computed(() => (skillInfo.value?.evolution?.length ?? 0) >
</script>
<template>
<div v-if="!skillInfo" class="flex items-center justify-center h-16 text-xs text-muted-foreground">
<div
v-if="!skillInfo"
class="flex items-center justify-center h-16 text-xs text-muted-foreground"
>
加载中…
</div>
@@ -139,7 +138,9 @@ const hasEvolution = computed(() => (skillInfo.value?.evolution?.length ?? 0) >
<div class="text-xs font-semibold text-purple-400 mb-1.5">{{ evo.name }}</div>
<div
class="text-xs leading-relaxed text-muted-foreground whitespace-pre-wrap max-h-36 overflow-y-auto"
>{{ evo.descDetail }}</div>
>
{{ evo.descDetail }}
</div>
</div>
</div>
</div>