From 91cc30bf356f5bda629a5ec58e5a9db9245a5e86 Mon Sep 17 00:00:00 2001 From: exoego Date: Sat, 18 Apr 2020 06:57:30 +0900 Subject: [PATCH] Use object instead of Map, which is not supported in IE9/10 --- src/index.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/index.js b/src/index.js index f2fa32c52..277f3ee22 100644 --- a/src/index.js +++ b/src/index.js @@ -41,7 +41,7 @@ export default class VueI18n { _root: any _sync: boolean _fallbackRoot: boolean - _localeChainCache: Map> + _localeChainCache: { [key: string]: Array; } _missing: ?MissingHandler _exist: Function _silentTranslationWarn: boolean | RegExp @@ -237,7 +237,7 @@ export default class VueI18n { get fallbackLocale (): Locale { return this._vm.fallbackLocale } set fallbackLocale (locale: Locale): void { - this._localeChainCache = new Map() + this._localeChainCache = {} this._vm.$set(this._vm, 'fallbackLocale', locale) } @@ -500,10 +500,10 @@ export default class VueI18n { if (start === '') { return [] } if (!this._localeChainCache) { - this._localeChainCache = new Map() + this._localeChainCache = {} } - let chain = this._localeChainCache.get(start) + let chain = this._localeChainCache[start] if (!chain) { if (!fallbackLocale) { fallbackLocale = this.fallbackLocale @@ -549,7 +549,7 @@ export default class VueI18n { null ) } - this._localeChainCache.set(start, chain) + this._localeChainCache[start] = chain } return chain }