diff --git a/components/utils/APILoader.js b/components/utils/APILoader.js index 0ee00bc..8c46c68 100644 --- a/components/utils/APILoader.js +++ b/components/utils/APILoader.js @@ -13,6 +13,9 @@ export default class APILoader { constructor({ key, useAMapUI, version, protocol }) { this.config = { ...DEFAULT_CONFIG, useAMapUI, protocol } if (typeof window !== 'undefined') { + if (this.config.key !== key) { + mainPromise = null + } if (key) { this.config.key = key } else if ('amapkey' in window) {