@v2coding/ui 0.1.55 → 0.1.56

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -12875,10 +12875,20 @@ var mixin = {
12875
12875
  }
12876
12876
  };
12877
12877
 
12878
+ let isReady = false;
12879
+ const onReadyCallbacks = [];
12880
+ const onReady = callback => {
12881
+ if (isReady) {
12882
+ callback();
12883
+ return;
12884
+ }
12885
+
12886
+ onReadyCallbacks.push(callback);
12887
+ };
12878
12888
  var index = {
12879
12889
  install: (Vue, opt) => {
12880
12890
  const {
12881
- onReady,
12891
+ onReady: _onReady,
12882
12892
  ...options
12883
12893
  } = opt;
12884
12894
  const {
@@ -12891,15 +12901,22 @@ var index = {
12891
12901
  Vue.use(Directives, options);
12892
12902
  Vue.use(Components, options);
12893
12903
 
12894
- if (typeof onReady === 'function') {
12895
- onReady({
12904
+ if (typeof _onReady === 'function') {
12905
+ _onReady({
12896
12906
  axios,
12897
12907
  store,
12898
12908
  router
12899
12909
  });
12900
12910
  }
12911
+
12912
+ isReady = true;
12913
+
12914
+ while (onReadyCallbacks.length) {
12915
+ const callback = onReadyCallbacks.shift();
12916
+ typeof callback === 'function' && callback();
12917
+ }
12901
12918
  },
12902
12919
  Components: ComponentList
12903
12920
  };
12904
12921
 
12905
- export { arrays as Arrays, Axios, Date$1 as Dates, FieldMixin, mixin as HistoryMixin, Objects, Router, Store, Strings, Upload, addFieldType, index as default, getAMap };
12922
+ export { arrays as Arrays, Axios, Date$1 as Dates, FieldMixin, mixin as HistoryMixin, Objects, Router, Store, Strings, Upload, addFieldType, index as default, getAMap, onReady };