@dcloudio/vue-cli-plugin-uni 2.0.1-alpha-36120220907002 → 2.0.1-alpha-36220220914001

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dcloudio/vue-cli-plugin-uni",
3
- "version": "2.0.1-alpha-36120220907002",
3
+ "version": "2.0.1-alpha-36220220914001",
4
4
  "description": "uni-app plugin for vue-cli 3",
5
5
  "main": "index.js",
6
6
  "repository": {
@@ -17,7 +17,7 @@
17
17
  "author": "fxy060608",
18
18
  "license": "Apache-2.0",
19
19
  "dependencies": {
20
- "@dcloudio/uni-stat": "^2.0.1-alpha-36120220907002",
20
+ "@dcloudio/uni-stat": "^2.0.1-alpha-36220220914001",
21
21
  "buffer-json": "^2.0.0",
22
22
  "clone-deep": "^4.0.1",
23
23
  "cross-env": "^5.2.0",
@@ -41,5 +41,5 @@
41
41
  "copy-webpack-plugin": ">=5",
42
42
  "postcss": ">=7"
43
43
  },
44
- "gitHead": "11b3ae743d9e35e4a5f7a12be93711fe1c415f74"
44
+ "gitHead": "b3900db2d6c797fefd7345e88a283af868cb7db3"
45
45
  }
@@ -2230,17 +2230,17 @@ function updateListeners (
2230
2230
 
2231
2231
  /* */
2232
2232
 
2233
- // fixed by xxxxxx (mp properties)
2234
- function extractPropertiesFromVNodeData(data, Ctor, res, context) {
2235
- var propOptions = Ctor.options.mpOptions && Ctor.options.mpOptions.properties;
2236
- if (isUndef(propOptions)) {
2237
- return res
2233
+ // fixed by xxxxxx (mp properties)
2234
+ function extractPropertiesFromVNodeData(data, Ctor, res, context) {
2235
+ var propOptions = Ctor.options.mpOptions && Ctor.options.mpOptions.properties;
2236
+ if (isUndef(propOptions)) {
2237
+ return res
2238
2238
  }
2239
- var externalClasses = Ctor.options.mpOptions.externalClasses || [];
2239
+ var externalClasses = Ctor.options.mpOptions.externalClasses || [];
2240
2240
  var attrs = data.attrs;
2241
- var props = data.props;
2242
- if (isDef(attrs) || isDef(props)) {
2243
- for (var key in propOptions) {
2241
+ var props = data.props;
2242
+ if (isDef(attrs) || isDef(props)) {
2243
+ for (var key in propOptions) {
2244
2244
  var altKey = hyphenate(key);
2245
2245
  var result = checkProp(res, props, key, altKey, true) ||
2246
2246
  checkProp(res, attrs, key, altKey, false);
@@ -2253,10 +2253,10 @@ function extractPropertiesFromVNodeData(data, Ctor, res, context) {
2253
2253
  ) {
2254
2254
  // 赋值 externalClass 真正的值(模板里 externalClass 的值可能是字符串)
2255
2255
  res[key] = context[camelize(res[key])];
2256
- }
2257
- }
2258
- }
2259
- return res
2256
+ }
2257
+ }
2258
+ }
2259
+ return res
2260
2260
  }
2261
2261
 
2262
2262
  function extractPropsFromVNodeData (
@@ -5522,138 +5522,138 @@ function type(obj) {
5522
5522
  return Object.prototype.toString.call(obj)
5523
5523
  }
5524
5524
 
5525
- /* */
5526
-
5527
- function flushCallbacks$1(vm) {
5528
- if (vm.__next_tick_callbacks && vm.__next_tick_callbacks.length) {
5529
- if (process.env.VUE_APP_DEBUG) {
5530
- var mpInstance = vm.$scope;
5531
- console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
5532
- ']:flushCallbacks[' + vm.__next_tick_callbacks.length + ']');
5533
- }
5534
- var copies = vm.__next_tick_callbacks.slice(0);
5535
- vm.__next_tick_callbacks.length = 0;
5536
- for (var i = 0; i < copies.length; i++) {
5537
- copies[i]();
5538
- }
5539
- }
5540
- }
5541
-
5542
- function hasRenderWatcher(vm) {
5543
- return queue.find(function (watcher) { return vm._watcher === watcher; })
5544
- }
5545
-
5546
- function nextTick$1(vm, cb) {
5547
- //1.nextTick 之前 已 setData 且 setData 还未回调完成
5548
- //2.nextTick 之前存在 render watcher
5525
+ /* */
5526
+
5527
+ function flushCallbacks$1(vm) {
5528
+ if (vm.__next_tick_callbacks && vm.__next_tick_callbacks.length) {
5529
+ if (process.env.VUE_APP_DEBUG) {
5530
+ var mpInstance = vm.$scope;
5531
+ console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
5532
+ ']:flushCallbacks[' + vm.__next_tick_callbacks.length + ']');
5533
+ }
5534
+ var copies = vm.__next_tick_callbacks.slice(0);
5535
+ vm.__next_tick_callbacks.length = 0;
5536
+ for (var i = 0; i < copies.length; i++) {
5537
+ copies[i]();
5538
+ }
5539
+ }
5540
+ }
5541
+
5542
+ function hasRenderWatcher(vm) {
5543
+ return queue.find(function (watcher) { return vm._watcher === watcher; })
5544
+ }
5545
+
5546
+ function nextTick$1(vm, cb) {
5547
+ //1.nextTick 之前 已 setData 且 setData 还未回调完成
5548
+ //2.nextTick 之前存在 render watcher
5549
5549
  if (!vm.__next_tick_pending && !hasRenderWatcher(vm)) {
5550
5550
  if(process.env.VUE_APP_DEBUG){
5551
5551
  var mpInstance = vm.$scope;
5552
5552
  console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
5553
5553
  ']:nextVueTick');
5554
- }
5555
- return nextTick(cb, vm)
5554
+ }
5555
+ return nextTick(cb, vm)
5556
5556
  }else{
5557
5557
  if(process.env.VUE_APP_DEBUG){
5558
5558
  var mpInstance$1 = vm.$scope;
5559
5559
  console.log('[' + (+new Date) + '][' + (mpInstance$1.is || mpInstance$1.route) + '][' + vm._uid +
5560
5560
  ']:nextMPTick');
5561
5561
  }
5562
- }
5563
- var _resolve;
5564
- if (!vm.__next_tick_callbacks) {
5565
- vm.__next_tick_callbacks = [];
5566
- }
5567
- vm.__next_tick_callbacks.push(function () {
5568
- if (cb) {
5569
- try {
5570
- cb.call(vm);
5571
- } catch (e) {
5572
- handleError(e, vm, 'nextTick');
5573
- }
5574
- } else if (_resolve) {
5575
- _resolve(vm);
5576
- }
5577
- });
5578
- // $flow-disable-line
5579
- if (!cb && typeof Promise !== 'undefined') {
5580
- return new Promise(function (resolve) {
5581
- _resolve = resolve;
5582
- })
5583
- }
5584
- }
5585
-
5586
- /* */
5587
-
5588
- function cloneWithData(vm) {
5589
- // 确保当前 vm 所有数据被同步
5590
- var ret = Object.create(null);
5591
- var dataKeys = [].concat(
5592
- Object.keys(vm._data || {}),
5593
- Object.keys(vm._computedWatchers || {}));
5594
-
5595
- dataKeys.reduce(function(ret, key) {
5596
- ret[key] = vm[key];
5597
- return ret
5598
- }, ret);
5599
-
5600
- // vue-composition-api
5601
- var compositionApiState = vm.__composition_api_state__ || vm.__secret_vfa_state__;
5602
- var rawBindings = compositionApiState && compositionApiState.rawBindings;
5603
- if (rawBindings) {
5604
- Object.keys(rawBindings).forEach(function (key) {
5605
- ret[key] = vm[key];
5606
- });
5607
- }
5608
-
5609
- //TODO 需要把无用数据处理掉,比如 list=>l0 则 list 需要移除,否则多传输一份数据
5610
- Object.assign(ret, vm.$mp.data || {});
5611
- if (
5612
- Array.isArray(vm.$options.behaviors) &&
5613
- vm.$options.behaviors.indexOf('uni://form-field') !== -1
5614
- ) { //form-field
5615
- ret['name'] = vm.name;
5616
- ret['value'] = vm.value;
5617
- }
5618
-
5619
- return JSON.parse(JSON.stringify(ret))
5620
- }
5621
-
5562
+ }
5563
+ var _resolve;
5564
+ if (!vm.__next_tick_callbacks) {
5565
+ vm.__next_tick_callbacks = [];
5566
+ }
5567
+ vm.__next_tick_callbacks.push(function () {
5568
+ if (cb) {
5569
+ try {
5570
+ cb.call(vm);
5571
+ } catch (e) {
5572
+ handleError(e, vm, 'nextTick');
5573
+ }
5574
+ } else if (_resolve) {
5575
+ _resolve(vm);
5576
+ }
5577
+ });
5578
+ // $flow-disable-line
5579
+ if (!cb && typeof Promise !== 'undefined') {
5580
+ return new Promise(function (resolve) {
5581
+ _resolve = resolve;
5582
+ })
5583
+ }
5584
+ }
5585
+
5586
+ /* */
5587
+
5588
+ function cloneWithData(vm) {
5589
+ // 确保当前 vm 所有数据被同步
5590
+ var ret = Object.create(null);
5591
+ var dataKeys = [].concat(
5592
+ Object.keys(vm._data || {}),
5593
+ Object.keys(vm._computedWatchers || {}));
5594
+
5595
+ dataKeys.reduce(function(ret, key) {
5596
+ ret[key] = vm[key];
5597
+ return ret
5598
+ }, ret);
5599
+
5600
+ // vue-composition-api
5601
+ var compositionApiState = vm.__composition_api_state__ || vm.__secret_vfa_state__;
5602
+ var rawBindings = compositionApiState && compositionApiState.rawBindings;
5603
+ if (rawBindings) {
5604
+ Object.keys(rawBindings).forEach(function (key) {
5605
+ ret[key] = vm[key];
5606
+ });
5607
+ }
5608
+
5609
+ //TODO 需要把无用数据处理掉,比如 list=>l0 则 list 需要移除,否则多传输一份数据
5610
+ Object.assign(ret, vm.$mp.data || {});
5611
+ if (
5612
+ Array.isArray(vm.$options.behaviors) &&
5613
+ vm.$options.behaviors.indexOf('uni://form-field') !== -1
5614
+ ) { //form-field
5615
+ ret['name'] = vm.name;
5616
+ ret['value'] = vm.value;
5617
+ }
5618
+
5619
+ return JSON.parse(JSON.stringify(ret))
5620
+ }
5621
+
5622
5622
  var patch = function(oldVnode, vnode) {
5623
5623
  var this$1 = this;
5624
-
5625
- if (vnode === null) { //destroy
5626
- return
5627
- }
5628
- if (this.mpType === 'page' || this.mpType === 'component') {
5629
- var mpInstance = this.$scope;
5630
- var data = Object.create(null);
5631
- try {
5632
- data = cloneWithData(this);
5633
- } catch (err) {
5634
- console.error(err);
5635
- }
5636
- data.__webviewId__ = mpInstance.data.__webviewId__;
5637
- var mpData = Object.create(null);
5638
- Object.keys(data).forEach(function (key) { //仅同步 data 中有的数据
5639
- mpData[key] = mpInstance.data[key];
5640
- });
5641
- var diffData = this.$shouldDiffData === false ? data : diff(data, mpData);
5642
- if (Object.keys(diffData).length) {
5643
- if (process.env.VUE_APP_DEBUG) {
5644
- console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + this._uid +
5645
- ']差量更新',
5646
- JSON.stringify(diffData));
5647
- }
5648
- this.__next_tick_pending = true;
5649
- mpInstance.setData(diffData, function () {
5650
- this$1.__next_tick_pending = false;
5651
- flushCallbacks$1(this$1);
5652
- });
5653
- } else {
5654
- flushCallbacks$1(this);
5655
- }
5656
- }
5624
+
5625
+ if (vnode === null) { //destroy
5626
+ return
5627
+ }
5628
+ if (this.mpType === 'page' || this.mpType === 'component') {
5629
+ var mpInstance = this.$scope;
5630
+ var data = Object.create(null);
5631
+ try {
5632
+ data = cloneWithData(this);
5633
+ } catch (err) {
5634
+ console.error(err);
5635
+ }
5636
+ data.__webviewId__ = mpInstance.data.__webviewId__;
5637
+ var mpData = Object.create(null);
5638
+ Object.keys(data).forEach(function (key) { //仅同步 data 中有的数据
5639
+ mpData[key] = mpInstance.data[key];
5640
+ });
5641
+ var diffData = this.$shouldDiffData === false ? data : diff(data, mpData);
5642
+ if (Object.keys(diffData).length) {
5643
+ if (process.env.VUE_APP_DEBUG) {
5644
+ console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + this._uid +
5645
+ ']差量更新',
5646
+ JSON.stringify(diffData));
5647
+ }
5648
+ this.__next_tick_pending = true;
5649
+ mpInstance.setData(diffData, function () {
5650
+ this$1.__next_tick_pending = false;
5651
+ flushCallbacks$1(this$1);
5652
+ });
5653
+ } else {
5654
+ flushCallbacks$1(this);
5655
+ }
5656
+ }
5657
5657
  };
5658
5658
 
5659
5659
  /* */
@@ -5794,253 +5794,256 @@ function normalizeStyleBinding (bindingStyle) {
5794
5794
  return bindingStyle
5795
5795
  }
5796
5796
 
5797
- /* */
5798
-
5799
- var MP_METHODS = ['createSelectorQuery', 'createIntersectionObserver', 'selectAllComponents', 'selectComponent'];
5800
-
5801
- function getTarget(obj, path) {
5802
- var parts = path.split('.');
5803
- var key = parts[0];
5804
- if (key.indexOf('__$n') === 0) { //number index
5805
- key = parseInt(key.replace('__$n', ''));
5806
- }
5807
- if (parts.length === 1) {
5808
- return obj[key]
5809
- }
5810
- return getTarget(obj[key], parts.slice(1).join('.'))
5811
- }
5812
-
5813
- function internalMixin(Vue) {
5814
-
5815
- Vue.config.errorHandler = function(err, vm, info) {
5816
- Vue.util.warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
5817
- console.error(err);
5818
- /* eslint-disable no-undef */
5819
- var app = typeof getApp === 'function' && getApp();
5820
- if (app && app.onError) {
5821
- app.onError(err);
5822
- }
5823
- };
5824
-
5825
- var oldEmit = Vue.prototype.$emit;
5826
-
5827
- Vue.prototype.$emit = function(event) {
5828
- if (this.$scope && event) {
5829
- (this.$scope['_triggerEvent'] || this.$scope['triggerEvent']).call(this.$scope, event, {
5830
- __args__: toArray(arguments, 1)
5831
- });
5832
- }
5833
- return oldEmit.apply(this, arguments)
5834
- };
5835
-
5836
- Vue.prototype.$nextTick = function(fn) {
5837
- return nextTick$1(this, fn)
5838
- };
5839
-
5840
- MP_METHODS.forEach(function (method) {
5841
- Vue.prototype[method] = function(args) {
5842
- if (this.$scope && this.$scope[method]) {
5843
- return this.$scope[method](args)
5844
- }
5845
- // mp-alipay
5846
- if (typeof my === 'undefined') {
5847
- return
5848
- }
5849
- if (method === 'createSelectorQuery') {
5850
- /* eslint-disable no-undef */
5851
- return my.createSelectorQuery(args)
5852
- } else if (method === 'createIntersectionObserver') {
5853
- /* eslint-disable no-undef */
5854
- return my.createIntersectionObserver(args)
5855
- }
5856
- // TODO mp-alipay 暂不支持 selectAllComponents,selectComponent
5857
- };
5858
- });
5859
-
5860
- Vue.prototype.__init_provide = initProvide;
5861
-
5862
- Vue.prototype.__init_injections = initInjections;
5863
-
5864
- Vue.prototype.__call_hook = function(hook, args) {
5865
- var vm = this;
5866
- // #7573 disable dep collection when invoking lifecycle hooks
5867
- pushTarget();
5868
- var handlers = vm.$options[hook];
5869
- var info = hook + " hook";
5870
- var ret;
5871
- if (handlers) {
5872
- for (var i = 0, j = handlers.length; i < j; i++) {
5873
- ret = invokeWithErrorHandling(handlers[i], vm, args ? [args] : null, vm, info);
5874
- }
5875
- }
5876
- if (vm._hasHookEvent) {
5877
- vm.$emit('hook:' + hook, args);
5878
- }
5879
- popTarget();
5880
- return ret
5881
- };
5882
-
5883
- Vue.prototype.__set_model = function(target, key, value, modifiers) {
5884
- if (Array.isArray(modifiers)) {
5885
- if (modifiers.indexOf('trim') !== -1) {
5886
- value = value.trim();
5887
- }
5888
- if (modifiers.indexOf('number') !== -1) {
5889
- value = this._n(value);
5890
- }
5891
- }
5892
- if (!target) {
5893
- target = this;
5894
- }
5895
- // 解决动态属性添加
5896
- Vue.set(target, key, value);
5897
- };
5898
-
5899
- Vue.prototype.__set_sync = function(target, key, value) {
5900
- if (!target) {
5901
- target = this;
5902
- }
5903
- // 解决动态属性添加
5904
- Vue.set(target, key, value);
5905
- };
5906
-
5907
- Vue.prototype.__get_orig = function(item) {
5908
- if (isPlainObject(item)) {
5909
- return item['$orig'] || item
5910
- }
5911
- return item
5912
- };
5913
-
5914
- Vue.prototype.__get_value = function(dataPath, target) {
5915
- return getTarget(target || this, dataPath)
5916
- };
5917
-
5918
-
5919
- Vue.prototype.__get_class = function(dynamicClass, staticClass) {
5920
- return renderClass(staticClass, dynamicClass)
5921
- };
5922
-
5923
- Vue.prototype.__get_style = function(dynamicStyle, staticStyle) {
5924
- if (!dynamicStyle && !staticStyle) {
5925
- return ''
5926
- }
5927
- var dynamicStyleObj = normalizeStyleBinding(dynamicStyle);
5928
- var styleObj = staticStyle ? extend(staticStyle, dynamicStyleObj) : dynamicStyleObj;
5929
- return Object.keys(styleObj).map(function (name) { return ((hyphenate(name)) + ":" + (styleObj[name])); }).join(';')
5930
- };
5931
-
5932
- Vue.prototype.__map = function(val, iteratee) {
5933
- //TODO 暂不考虑 string
5934
- var ret, i, l, keys, key;
5935
- if (Array.isArray(val)) {
5936
- ret = new Array(val.length);
5937
- for (i = 0, l = val.length; i < l; i++) {
5938
- ret[i] = iteratee(val[i], i);
5939
- }
5940
- return ret
5941
- } else if (isObject(val)) {
5942
- keys = Object.keys(val);
5943
- ret = Object.create(null);
5944
- for (i = 0, l = keys.length; i < l; i++) {
5945
- key = keys[i];
5946
- ret[key] = iteratee(val[key], key, i);
5947
- }
5948
- return ret
5949
- } else if (typeof val === 'number') {
5950
- ret = new Array(val);
5951
- for (i = 0, l = val; i < l; i++) {
5952
- // 第一个参数暂时仍和小程序一致
5953
- ret[i] = iteratee(i, i);
5954
- }
5955
- return ret
5956
- }
5957
- return []
5958
- };
5959
-
5960
- }
5961
-
5962
- /* */
5963
-
5964
- var LIFECYCLE_HOOKS$1 = [
5965
- //App
5966
- 'onLaunch',
5967
- 'onShow',
5968
- 'onHide',
5969
- 'onUniNViewMessage',
5970
- 'onPageNotFound',
5971
- 'onThemeChange',
5972
- 'onError',
5973
- 'onUnhandledRejection',
5974
- //Page
5975
- 'onInit',
5976
- 'onLoad',
5977
- // 'onShow',
5978
- 'onReady',
5979
- // 'onHide',
5980
- 'onUnload',
5981
- 'onPullDownRefresh',
5982
- 'onReachBottom',
5983
- 'onTabItemTap',
5984
- 'onAddToFavorites',
5985
- 'onShareTimeline',
5986
- 'onShareAppMessage',
5987
- 'onResize',
5988
- 'onPageScroll',
5989
- 'onNavigationBarButtonTap',
5990
- 'onBackPress',
5991
- 'onNavigationBarSearchInputChanged',
5992
- 'onNavigationBarSearchInputConfirmed',
5993
- 'onNavigationBarSearchInputClicked',
5994
- //Component
5995
- // 'onReady', // 兼容旧版本,应该移除该事件
5996
- 'onPageShow',
5997
- 'onPageHide',
5998
- 'onPageResize',
5999
- 'onUploadDouyinVideo'
6000
- ];
6001
- function lifecycleMixin$1(Vue) {
6002
-
6003
- //fixed vue-class-component
6004
- var oldExtend = Vue.extend;
6005
- Vue.extend = function(extendOptions) {
6006
- extendOptions = extendOptions || {};
6007
-
6008
- var methods = extendOptions.methods;
6009
- if (methods) {
6010
- Object.keys(methods).forEach(function (methodName) {
6011
- if (LIFECYCLE_HOOKS$1.indexOf(methodName)!==-1) {
6012
- extendOptions[methodName] = methods[methodName];
6013
- delete methods[methodName];
6014
- }
6015
- });
6016
- }
6017
-
6018
- return oldExtend.call(this, extendOptions)
6019
- };
6020
-
6021
- var strategies = Vue.config.optionMergeStrategies;
6022
- var mergeHook = strategies.created;
6023
- LIFECYCLE_HOOKS$1.forEach(function (hook) {
6024
- strategies[hook] = mergeHook;
6025
- });
6026
-
6027
- Vue.prototype.__lifecycle_hooks__ = LIFECYCLE_HOOKS$1;
6028
- }
6029
-
6030
- /* */
6031
-
6032
- // install platform patch function
6033
- Vue.prototype.__patch__ = patch;
6034
-
6035
- // public mount method
6036
- Vue.prototype.$mount = function(
6037
- el ,
6038
- hydrating
6039
- ) {
6040
- return mountComponent$1(this, el, hydrating)
6041
- };
6042
-
6043
- lifecycleMixin$1(Vue);
5797
+ /* */
5798
+
5799
+ var MP_METHODS = ['createSelectorQuery', 'createIntersectionObserver', 'selectAllComponents', 'selectComponent'];
5800
+
5801
+ function getTarget(obj, path) {
5802
+ var parts = path.split('.');
5803
+ var key = parts[0];
5804
+ if (key.indexOf('__$n') === 0) { //number index
5805
+ key = parseInt(key.replace('__$n', ''));
5806
+ }
5807
+ if (parts.length === 1) {
5808
+ return obj[key]
5809
+ }
5810
+ return getTarget(obj[key], parts.slice(1).join('.'))
5811
+ }
5812
+
5813
+ function internalMixin(Vue) {
5814
+
5815
+ Vue.config.errorHandler = function(err, vm, info) {
5816
+ Vue.util.warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
5817
+ console.error(err);
5818
+ /* eslint-disable no-undef */
5819
+ var app = typeof getApp === 'function' && getApp();
5820
+ if (app && app.onError) {
5821
+ app.onError(err);
5822
+ }
5823
+ };
5824
+
5825
+ var oldEmit = Vue.prototype.$emit;
5826
+
5827
+ Vue.prototype.$emit = function(event) {
5828
+ if (this.$scope && event) {
5829
+ var triggerEvent = this.$scope['_triggerEvent'] || this.$scope['triggerEvent'];
5830
+ if (triggerEvent) {
5831
+ triggerEvent.call(this.$scope, event, {
5832
+ __args__: toArray(arguments, 1)
5833
+ });
5834
+ }
5835
+ }
5836
+ return oldEmit.apply(this, arguments)
5837
+ };
5838
+
5839
+ Vue.prototype.$nextTick = function(fn) {
5840
+ return nextTick$1(this, fn)
5841
+ };
5842
+
5843
+ MP_METHODS.forEach(function (method) {
5844
+ Vue.prototype[method] = function(args) {
5845
+ if (this.$scope && this.$scope[method]) {
5846
+ return this.$scope[method](args)
5847
+ }
5848
+ // mp-alipay
5849
+ if (typeof my === 'undefined') {
5850
+ return
5851
+ }
5852
+ if (method === 'createSelectorQuery') {
5853
+ /* eslint-disable no-undef */
5854
+ return my.createSelectorQuery(args)
5855
+ } else if (method === 'createIntersectionObserver') {
5856
+ /* eslint-disable no-undef */
5857
+ return my.createIntersectionObserver(args)
5858
+ }
5859
+ // TODO mp-alipay 暂不支持 selectAllComponents,selectComponent
5860
+ };
5861
+ });
5862
+
5863
+ Vue.prototype.__init_provide = initProvide;
5864
+
5865
+ Vue.prototype.__init_injections = initInjections;
5866
+
5867
+ Vue.prototype.__call_hook = function(hook, args) {
5868
+ var vm = this;
5869
+ // #7573 disable dep collection when invoking lifecycle hooks
5870
+ pushTarget();
5871
+ var handlers = vm.$options[hook];
5872
+ var info = hook + " hook";
5873
+ var ret;
5874
+ if (handlers) {
5875
+ for (var i = 0, j = handlers.length; i < j; i++) {
5876
+ ret = invokeWithErrorHandling(handlers[i], vm, args ? [args] : null, vm, info);
5877
+ }
5878
+ }
5879
+ if (vm._hasHookEvent) {
5880
+ vm.$emit('hook:' + hook, args);
5881
+ }
5882
+ popTarget();
5883
+ return ret
5884
+ };
5885
+
5886
+ Vue.prototype.__set_model = function(target, key, value, modifiers) {
5887
+ if (Array.isArray(modifiers)) {
5888
+ if (modifiers.indexOf('trim') !== -1) {
5889
+ value = value.trim();
5890
+ }
5891
+ if (modifiers.indexOf('number') !== -1) {
5892
+ value = this._n(value);
5893
+ }
5894
+ }
5895
+ if (!target) {
5896
+ target = this;
5897
+ }
5898
+ // 解决动态属性添加
5899
+ Vue.set(target, key, value);
5900
+ };
5901
+
5902
+ Vue.prototype.__set_sync = function(target, key, value) {
5903
+ if (!target) {
5904
+ target = this;
5905
+ }
5906
+ // 解决动态属性添加
5907
+ Vue.set(target, key, value);
5908
+ };
5909
+
5910
+ Vue.prototype.__get_orig = function(item) {
5911
+ if (isPlainObject(item)) {
5912
+ return item['$orig'] || item
5913
+ }
5914
+ return item
5915
+ };
5916
+
5917
+ Vue.prototype.__get_value = function(dataPath, target) {
5918
+ return getTarget(target || this, dataPath)
5919
+ };
5920
+
5921
+
5922
+ Vue.prototype.__get_class = function(dynamicClass, staticClass) {
5923
+ return renderClass(staticClass, dynamicClass)
5924
+ };
5925
+
5926
+ Vue.prototype.__get_style = function(dynamicStyle, staticStyle) {
5927
+ if (!dynamicStyle && !staticStyle) {
5928
+ return ''
5929
+ }
5930
+ var dynamicStyleObj = normalizeStyleBinding(dynamicStyle);
5931
+ var styleObj = staticStyle ? extend(staticStyle, dynamicStyleObj) : dynamicStyleObj;
5932
+ return Object.keys(styleObj).map(function (name) { return ((hyphenate(name)) + ":" + (styleObj[name])); }).join(';')
5933
+ };
5934
+
5935
+ Vue.prototype.__map = function(val, iteratee) {
5936
+ //TODO 暂不考虑 string
5937
+ var ret, i, l, keys, key;
5938
+ if (Array.isArray(val)) {
5939
+ ret = new Array(val.length);
5940
+ for (i = 0, l = val.length; i < l; i++) {
5941
+ ret[i] = iteratee(val[i], i);
5942
+ }
5943
+ return ret
5944
+ } else if (isObject(val)) {
5945
+ keys = Object.keys(val);
5946
+ ret = Object.create(null);
5947
+ for (i = 0, l = keys.length; i < l; i++) {
5948
+ key = keys[i];
5949
+ ret[key] = iteratee(val[key], key, i);
5950
+ }
5951
+ return ret
5952
+ } else if (typeof val === 'number') {
5953
+ ret = new Array(val);
5954
+ for (i = 0, l = val; i < l; i++) {
5955
+ // 第一个参数暂时仍和小程序一致
5956
+ ret[i] = iteratee(i, i);
5957
+ }
5958
+ return ret
5959
+ }
5960
+ return []
5961
+ };
5962
+
5963
+ }
5964
+
5965
+ /* */
5966
+
5967
+ var LIFECYCLE_HOOKS$1 = [
5968
+ //App
5969
+ 'onLaunch',
5970
+ 'onShow',
5971
+ 'onHide',
5972
+ 'onUniNViewMessage',
5973
+ 'onPageNotFound',
5974
+ 'onThemeChange',
5975
+ 'onError',
5976
+ 'onUnhandledRejection',
5977
+ //Page
5978
+ 'onInit',
5979
+ 'onLoad',
5980
+ // 'onShow',
5981
+ 'onReady',
5982
+ // 'onHide',
5983
+ 'onUnload',
5984
+ 'onPullDownRefresh',
5985
+ 'onReachBottom',
5986
+ 'onTabItemTap',
5987
+ 'onAddToFavorites',
5988
+ 'onShareTimeline',
5989
+ 'onShareAppMessage',
5990
+ 'onResize',
5991
+ 'onPageScroll',
5992
+ 'onNavigationBarButtonTap',
5993
+ 'onBackPress',
5994
+ 'onNavigationBarSearchInputChanged',
5995
+ 'onNavigationBarSearchInputConfirmed',
5996
+ 'onNavigationBarSearchInputClicked',
5997
+ //Component
5998
+ // 'onReady', // 兼容旧版本,应该移除该事件
5999
+ 'onPageShow',
6000
+ 'onPageHide',
6001
+ 'onPageResize',
6002
+ 'onUploadDouyinVideo'
6003
+ ];
6004
+ function lifecycleMixin$1(Vue) {
6005
+
6006
+ //fixed vue-class-component
6007
+ var oldExtend = Vue.extend;
6008
+ Vue.extend = function(extendOptions) {
6009
+ extendOptions = extendOptions || {};
6010
+
6011
+ var methods = extendOptions.methods;
6012
+ if (methods) {
6013
+ Object.keys(methods).forEach(function (methodName) {
6014
+ if (LIFECYCLE_HOOKS$1.indexOf(methodName)!==-1) {
6015
+ extendOptions[methodName] = methods[methodName];
6016
+ delete methods[methodName];
6017
+ }
6018
+ });
6019
+ }
6020
+
6021
+ return oldExtend.call(this, extendOptions)
6022
+ };
6023
+
6024
+ var strategies = Vue.config.optionMergeStrategies;
6025
+ var mergeHook = strategies.created;
6026
+ LIFECYCLE_HOOKS$1.forEach(function (hook) {
6027
+ strategies[hook] = mergeHook;
6028
+ });
6029
+
6030
+ Vue.prototype.__lifecycle_hooks__ = LIFECYCLE_HOOKS$1;
6031
+ }
6032
+
6033
+ /* */
6034
+
6035
+ // install platform patch function
6036
+ Vue.prototype.__patch__ = patch;
6037
+
6038
+ // public mount method
6039
+ Vue.prototype.$mount = function(
6040
+ el ,
6041
+ hydrating
6042
+ ) {
6043
+ return mountComponent$1(this, el, hydrating)
6044
+ };
6045
+
6046
+ lifecycleMixin$1(Vue);
6044
6047
  internalMixin(Vue);
6045
6048
 
6046
6049
  /* */