fix type error of i18n.ts

This commit is contained in:
Lhcfl 2024-04-04 15:20:15 +08:00
parent 2505b58f99
commit ee3ce22b74
1 changed files with 8 additions and 7 deletions

View File

@ -38,13 +38,14 @@ export default defineComponent({
return h(
this.tag,
parsed.map((x) =>
typeof x === "string"
? this.textTag
? h(this.textTag, x)
: x
: this.$slots[x.arg](),
),
parsed.map((x) => {
if (typeof x === "string") {
return this.textTag ? h(this.textTag, x) : x;
} else {
const t = this.$slots[x.arg];
return t ? t() : `I18n[${x.arg}]`;
}
}),
);
},
});