提交 5aa816bc 编写于 作者: fxy060608's avatar fxy060608

chore: merge

......@@ -52,7 +52,7 @@ function generatePagesJsonCode(
return `
import { defineAsyncComponent, resolveComponent, createVNode, withCtx, openBlock, createBlock } from 'vue'
import { PageComponent, AsyncLoadingComponent, AsyncErrorComponent, useI18n, setupWindow, setupPage } from '@dcloudio/uni-h5'
import { PageComponent, useI18n, setupWindow, setupPage } from '@dcloudio/uni-h5'
import { appId, appName, appVersion, appVersionCode, debug, networkTimeout, router, async, sdkConfigs, qqMapKey, googleMapKey, aMapKey, aMapSecurityJsCode, aMapServiceHost, nvue, locale, fallbackLocale, darkmode, themeConfig } from './${MANIFEST_JSON_JS}'
const locales = import.meta.globEager('./locale/*.json')
${importLayoutComponentsCode}
......@@ -190,13 +190,27 @@ function generatePagesDefineCode(
const { pages } = pagesJson
return (
`const AsyncComponentOptions = {
loadingComponent: AsyncLoadingComponent,
errorComponent: AsyncErrorComponent,
delay: async.delay,
timeout: async.timeout,
suspensible: async.suspensible
}
` + pages.map((pageOptions) => generatePageDefineCode(pageOptions)).join('\n')
delay: async.delay,
timeout: async.timeout,
suspensible: async.suspensible
}
if(async.loading){
AsyncComponentOptions.loadingComponent = {
name:'SystemAsyncLoading',
render(){
return createVNode(resolveComponent(async.loading))
}
}
}
if(async.error){
AsyncComponentOptions.errorComponent = {
name:'SystemAsyncError',
render(){
return createVNode(resolveComponent(async.error))
}
}
}
` + pages.map((pageOptions) => generatePageDefineCode(pageOptions)).join('\n')
)
}
......
import { ComponentPublicInstance } from 'vue'
import AsyncLoadingComponent from '../components/async-loading'
import AsyncErrorComponent from '../components/async-error'
import {
initAppVm,
initService,
......@@ -14,6 +16,18 @@ export function getApp() {
export function initApp(vm: ComponentPublicInstance) {
appVm = vm
if (!appVm.$.appContext.app.component(AsyncLoadingComponent.name)) {
appVm.$.appContext.app.component(
AsyncLoadingComponent.name,
AsyncLoadingComponent
)
}
if (!appVm.$.appContext.app.component(AsyncErrorComponent.name)) {
appVm.$.appContext.app.component(
AsyncErrorComponent.name,
AsyncErrorComponent
)
}
initAppVm(appVm)
defineGlobalData(appVm)
initService()
......
......@@ -11,6 +11,7 @@ export function updateCurPageCssVar(pageMeta: UniApp.PageRouteMeta) {
let windowBottomValue = 0
if (
__UNI_FEATURE_NAVIGATIONBAR__ &&
pageMeta.navigationBar.style !== 'custom' &&
['default', 'float'].indexOf(pageMeta.navigationBar.type!) > -1
) {
windowTopValue = NAVBAR_HEIGHT
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册