From 98d2eafd6916d48d0af354e8ce27276b6d343a5e Mon Sep 17 00:00:00 2001 From: pingjustdoit <49084498+pingjustdoit@users.noreply.github.com> Date: Mon, 18 Jul 2022 11:21:17 +0800 Subject: [PATCH] Update APILoader.js Amap ,the latest version is limited way of introduction,add an external change parameter --- components/utils/APILoader.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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