refactor: fix types

This commit is contained in:
syuilo
2023-02-09 11:46:08 +09:00
parent 33c4e57994
commit 76faec2115
4 changed files with 5 additions and 6 deletions

View File

@@ -11,10 +11,9 @@ export class I18n<T extends Record<string, any>> {
// string にしているのは、ドット区切りでのパス指定を許可するため
// なるべくこのメソッド使うよりもlocale直接参照の方がvueのキャッシュ効いてパフォーマンスが良いかも
@bindThis
public t(key: string, args?: Record<string, any>): string {
try {
let str = key.split('.').reduce((o, i) => o[i], this.locale) as string;
let str = key.split('.').reduce((o, i) => o[i], this.locale as any) as string;
if (args) {
for (const [k, v] of Object.entries(args)) {