@dcloudio/uni-app-plus 2.0.1-alpha-34320220401001 → 2.0.1-alpha-34420220402001

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/dist/index.v3.js CHANGED
@@ -3020,8 +3020,7 @@ var serviceContext = (function () {
3020
3020
 
3021
3021
  const pageScrollTo = {
3022
3022
  scrollTop: {
3023
- type: Number,
3024
- required: true
3023
+ type: Number
3025
3024
  },
3026
3025
  duration: {
3027
3026
  type: Number,
@@ -6195,7 +6194,7 @@ var serviceContext = (function () {
6195
6194
  /**
6196
6195
  * 动态设置 tabBar 某一项的内容
6197
6196
  */
6198
- function setTabBarItem$1 (index, text, iconPath, selectedIconPath, visible) {
6197
+ function setTabBarItem$1 (index, text, iconPath, selectedIconPath, visible, iconfont) {
6199
6198
  const item = {
6200
6199
  index
6201
6200
  };
@@ -6207,6 +6206,9 @@ var serviceContext = (function () {
6207
6206
  }
6208
6207
  if (selectedIconPath) {
6209
6208
  item.selectedIconPath = getRealPath$1(selectedIconPath);
6209
+ }
6210
+ if (iconfont !== undefined) {
6211
+ item.iconfont = iconfont;
6210
6212
  }
6211
6213
  if (visible !== undefined) {
6212
6214
  item.visible = config.list[index].visible = visible;
@@ -11056,9 +11058,10 @@ var serviceContext = (function () {
11056
11058
  iconPath,
11057
11059
  selectedIconPath,
11058
11060
  pagePath,
11059
- visible
11061
+ visible,
11062
+ iconfont
11060
11063
  }) {
11061
- tabBar$1.setTabBarItem(index, text, iconPath, selectedIconPath, visible);
11064
+ tabBar$1.setTabBarItem(index, text, iconPath, selectedIconPath, visible, iconfont);
11062
11065
  const route = pagePath && __uniRoutes.find(({ path }) => path === pagePath);
11063
11066
  if (route) {
11064
11067
  const meta = route.meta;
@@ -23048,88 +23051,88 @@ var serviceContext = (function () {
23048
23051
  };
23049
23052
  }
23050
23053
 
23051
- function parsePageCreateOptions (vm, route) {
23052
- const pagePath = '/' + route;
23053
- const routeOptions = __uniRoutes.find(route => route.path === pagePath);
23054
-
23055
- const windowOptions = Object.assign({}, __uniConfig.window, routeOptions.window);
23056
- const disableScroll = windowOptions.disableScroll === true ? 1 : 0;
23057
- const onReachBottomDistance = hasOwn(windowOptions, 'onReachBottomDistance')
23058
- ? parseInt(windowOptions.onReachBottomDistance)
23059
- : ON_REACH_BOTTOM_DISTANCE;
23060
-
23061
- const onPageScroll = hasLifecycleHook(vm.$options, 'onPageScroll') ? 1 : 0;
23062
- const onPageReachBottom = hasLifecycleHook(vm.$options, 'onReachBottom') ? 1 : 0;
23063
- const statusbarHeight = getStatusbarHeight();
23064
-
23065
- return {
23066
- version: VD_SYNC_VERSION,
23067
- locale: weex.requireModule('plus').getLanguage(),
23068
- disableScroll,
23069
- onPageScroll,
23070
- onPageReachBottom,
23071
- onReachBottomDistance,
23072
- statusbarHeight,
23073
- windowTop: windowOptions.titleNView && windowOptions.titleNView.type === 'float' ? (statusbarHeight +
23074
- NAVBAR_HEIGHT) : 0,
23075
- windowBottom: (tabBar$1.indexOf(route) >= 0 && tabBar$1.cover) ? tabBar$1.height : 0
23076
- }
23077
- }
23078
-
23079
- function initLifecycle (Vue) {
23080
- lifecycleMixin(Vue);
23081
-
23082
- Vue.mixin({
23083
- beforeCreate () {
23084
- // TODO 临时解决方案,service 层也注入 wxs (适用于工具类)
23085
- const options = this.$options;
23086
-
23087
- // 自动挂载 $store
23088
- if (options.store && !Vue.prototype.$store) {
23089
- Vue.prototype.$store = options.store;
23090
- }
23091
-
23092
- const wxs = options.wxs;
23093
- if (wxs) {
23094
- Object.keys(wxs).forEach(module => {
23095
- this[module] = wxs[module];
23096
- });
23097
- }
23098
-
23099
- if (this.mpType === 'page') {
23100
- const app = getApp();
23101
- if (app.$vm && app.$vm.$i18n) {
23102
- this._i18n = app.$vm.$i18n;
23103
- }
23104
- this.$scope = this.$options.pageInstance;
23105
- this.$scope.$vm = this;
23106
- delete this.$options.pageInstance;
23107
-
23108
- const route = this.$scope.route;
23109
- const pageId = this.$scope.$page.id;
23110
- // 通知页面已开始创建
23111
- this._$vd.sendPageCreate([pageId, route, parsePageCreateOptions(this, route)]);
23112
- }
23113
- },
23114
- created () {
23115
- if (this.mpType === 'page') {
23116
- // 理论上应该从最开始的 parseQuery 的地方直接 decode 两次,为了减少影响范围,先仅处理 onLoad 参数
23117
- callPageHook(this.$scope, 'onLoad', decodedQuery(this.$options.pageQuery));
23118
- callPageHook(this.$scope, 'onShow');
23119
- }
23120
- },
23121
- beforeDestroy () {
23122
- if (this.mpType === 'page') {
23123
- callPageHook(this.$scope, 'onUnload');
23124
- }
23125
- },
23126
- mounted () {
23127
- if (this.mpType === 'page') {
23128
- callPageHook(this.$scope, 'onReady');
23129
- preloadSubPackages(this.$scope.route);
23130
- }
23131
- }
23132
- });
23054
+ function parsePageCreateOptions (vm, route) {
23055
+ const pagePath = '/' + route;
23056
+ const routeOptions = __uniRoutes.find(route => route.path === pagePath);
23057
+
23058
+ const windowOptions = Object.assign({}, __uniConfig.window, routeOptions.window);
23059
+ const disableScroll = windowOptions.disableScroll === true ? 1 : 0;
23060
+ const onReachBottomDistance = hasOwn(windowOptions, 'onReachBottomDistance')
23061
+ ? parseInt(windowOptions.onReachBottomDistance)
23062
+ : ON_REACH_BOTTOM_DISTANCE;
23063
+
23064
+ const onPageScroll = hasLifecycleHook(vm.$options, 'onPageScroll') ? 1 : 0;
23065
+ const onPageReachBottom = hasLifecycleHook(vm.$options, 'onReachBottom') ? 1 : 0;
23066
+ const statusbarHeight = getStatusbarHeight();
23067
+
23068
+ return {
23069
+ version: VD_SYNC_VERSION,
23070
+ locale: weex.requireModule('plus').getLanguage(),
23071
+ disableScroll,
23072
+ onPageScroll,
23073
+ onPageReachBottom,
23074
+ onReachBottomDistance,
23075
+ statusbarHeight,
23076
+ windowTop: windowOptions.titleNView && windowOptions.titleNView.type === 'float' ? (statusbarHeight +
23077
+ NAVBAR_HEIGHT) : 0,
23078
+ windowBottom: (tabBar$1.indexOf(route) >= 0 && tabBar$1.cover) ? tabBar$1.height : 0
23079
+ }
23080
+ }
23081
+
23082
+ function initLifecycle (Vue) {
23083
+ lifecycleMixin(Vue);
23084
+
23085
+ Vue.mixin({
23086
+ beforeCreate () {
23087
+ // TODO 临时解决方案,service 层也注入 wxs (适用于工具类)
23088
+ const options = this.$options;
23089
+
23090
+ // 自动挂载 $store
23091
+ if (options.store && !Vue.prototype.$store) {
23092
+ Vue.prototype.$store = options.store;
23093
+ }
23094
+
23095
+ const wxs = options.wxs;
23096
+ if (wxs) {
23097
+ Object.keys(wxs).forEach(module => {
23098
+ this[module] = wxs[module];
23099
+ });
23100
+ }
23101
+
23102
+ if (this.mpType === 'page') {
23103
+ const app = getApp();
23104
+ if (app.$vm && app.$vm.$i18n) {
23105
+ this._i18n = app.$vm.$i18n;
23106
+ }
23107
+ this.$scope = this.$options.pageInstance;
23108
+ this.$scope.$vm = this;
23109
+ delete this.$options.pageInstance;
23110
+
23111
+ const route = this.$scope.route;
23112
+ const pageId = this.$scope.$page.id;
23113
+ // 通知页面已开始创建
23114
+ this._$vd.sendPageCreate([pageId, route, parsePageCreateOptions(this, route)]);
23115
+ }
23116
+ },
23117
+ created () {
23118
+ if (this.mpType === 'page') {
23119
+ // 理论上应该从最开始的 parseQuery 的地方直接 decode 两次,为了减少影响范围,先仅处理 onLoad 参数
23120
+ callPageHook(this.$scope, 'onLoad', decodedQuery(this.$options.pageQuery));
23121
+ callPageHook(this.$scope, 'onShow');
23122
+ }
23123
+ },
23124
+ beforeDestroy () {
23125
+ if (this.mpType === 'page') {
23126
+ callPageHook(this.$scope, 'onUnload');
23127
+ }
23128
+ },
23129
+ mounted () {
23130
+ if (this.mpType === 'page') {
23131
+ callPageHook(this.$scope, 'onReady');
23132
+ preloadSubPackages(this.$scope.route);
23133
+ }
23134
+ }
23135
+ });
23133
23136
  }
23134
23137
 
23135
23138
  var vuePlugin = {