Skip to content

Commit

Permalink
feat: ssr自动添加的代码增加ts-ignore忽略类型校验报错
Browse files Browse the repository at this point in the history
  • Loading branch information
Wangyaqi committed May 10, 2024
1 parent 43e0021 commit 377a727
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/uni-h5-vite/src/plugins/mainJs.ts
Expand Up @@ -52,7 +52,7 @@ function createLegacyApp(code: string) {
}

function createSSRClientApp(code: string) {
return `import { plugin as __plugin } from '@dcloudio/uni-h5';import { UNI_SSR, UNI_SSR_STORE } from '@dcloudio/uni-shared';${code};const { app: __app, store: __store } = createApp();__app.use(__plugin);__store && window[UNI_SSR] && window[UNI_SSR][UNI_SSR_STORE] && __store.replaceState(window[UNI_SSR][UNI_SSR_STORE]);__app.router.isReady().then(() => __app.mount("#app"));`
return `import { plugin as __plugin } from '@dcloudio/uni-h5';import { UNI_SSR, UNI_SSR_STORE } from '@dcloudio/uni-shared';${code};\n// @ts-ignore\nconst { app: __app, store: __store } = createApp();__app.use(__plugin);__store && window[UNI_SSR] && window[UNI_SSR][UNI_SSR_STORE] && __store.replaceState(window[UNI_SSR][UNI_SSR_STORE]);__app.router.isReady().then(() => __app.mount("#app"));`
}

function createSSRServerApp(code: string) {
Expand Down

0 comments on commit 377a727

Please sign in to comment.