diff --git a/packages/uni-app-plus/dist/index.v3.js b/packages/uni-app-plus/dist/index.v3.js index cc0b7fc5d75704a32d674b7d6d15fadc3d17cf96..9cf8f9fd4a844ffa9b8d4a13eaf67faa64fb0c9e 100644 --- a/packages/uni-app-plus/dist/index.v3.js +++ b/packages/uni-app-plus/dist/index.v3.js @@ -12986,7 +12986,8 @@ var serviceContext = (function () { onPageReachBottom, onReachBottomDistance, statusbarHeight, - windowTop: windowOptions.titleNView && windowOptions.titleNView.type === 'float' ? (statusbarHeight + TITLEBAR_HEIGHT) : 0, + windowTop: windowOptions.titleNView && windowOptions.titleNView.type === 'float' ? (statusbarHeight + + TITLEBAR_HEIGHT) : 0, windowBottom: (tabBar$1.indexOf(route) >= 0 && tabBar$1.cover) ? tabBar$1.height : 0 } } @@ -12999,6 +13000,11 @@ var serviceContext = (function () { // TODO 临时解决方案,service 层也注入 wxs (适用于工具类) const options = this.$options; + // 自动挂载 $store + if (options.store && !Vue.prototype.$store) { + Vue.prototype.$store = options.store; + } + const wxs = options.wxs; if (wxs) { Object.keys(wxs).forEach(module => { diff --git a/src/platforms/app-plus/service/framework/plugins/lifecycle.js b/src/platforms/app-plus/service/framework/plugins/lifecycle.js index e74a1ec56d8d5be9822818b4e66eada261d70854..604fa427666eda61854bd08592d68ca3f6416ac3 100644 --- a/src/platforms/app-plus/service/framework/plugins/lifecycle.js +++ b/src/platforms/app-plus/service/framework/plugins/lifecycle.js @@ -47,7 +47,8 @@ function parsePageCreateOptions (vm, route) { onPageReachBottom, onReachBottomDistance, statusbarHeight, - windowTop: windowOptions.titleNView && windowOptions.titleNView.type === 'float' ? (statusbarHeight + TITLEBAR_HEIGHT) : 0, + windowTop: windowOptions.titleNView && windowOptions.titleNView.type === 'float' ? (statusbarHeight + + TITLEBAR_HEIGHT) : 0, windowBottom: (tabBar.indexOf(route) >= 0 && tabBar.cover) ? tabBar.height : 0 } } @@ -60,6 +61,11 @@ export function initLifecycle (Vue) { // TODO 临时解决方案,service 层也注入 wxs (适用于工具类) const options = this.$options + // 自动挂载 $store + if (options.store && !Vue.prototype.$store) { + Vue.prototype.$store = options.store + } + const wxs = options.wxs if (wxs) { Object.keys(wxs).forEach(module => { @@ -95,4 +101,4 @@ export function initLifecycle (Vue) { } } }) -} +}