diff --git a/components/utils/APILoader.js b/components/utils/APILoader.js index 0ee00bc..0ff8705 100644 --- a/components/utils/APILoader.js +++ b/components/utils/APILoader.js @@ -10,7 +10,7 @@ let mainPromise = null let amapuiPromise = null let amapuiInited = false export default class APILoader { - constructor({ key, useAMapUI, version, protocol }) { + constructor({ key,callback, useAMapUI, version, protocol }) { this.config = { ...DEFAULT_CONFIG, useAMapUI, protocol } if (typeof window !== 'undefined') { if (key) { @@ -18,6 +18,9 @@ export default class APILoader { } else if ('amapkey' in window) { this.config.key = window.amapkey } + if (callback) { + this.config.callback = callback + } } if (version) { this.config.v = version