Skip to content

Commit

Permalink
fix: vue3 add vue_devtool
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangyuang committed May 25, 2021
1 parent cc04a51 commit 35ab732
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion packages/plugin-vue3/src/entry/server-entry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ const { FeRoutes, App, layoutFetch, Layout, BASE_NAME } = Routes as RoutesType

const serverRender = async (ctx: ISSRContext, config: IConfig) => {
global.window = global.window ?? {} // 防止覆盖上层应用自己定义的 window 对象

// @ts-expect-error
global.__VUE_PROD_DEVTOOLS__ = global.__VUE_PROD_DEVTOOLS__ ?? false
const router = createRouter()
let path = ctx.request.path // 这里取 pathname 不能够包含 queyString
if (BASE_NAME) {
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-vue3/src/global.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ declare global {
__VUE_ROUTER__?: Router
__USE_VITE__?: boolean
}
const __VUE_PROD_DEVTOOLS__ = boolean
const __isBrowser__: Boolean
}

0 comments on commit 35ab732

Please sign in to comment.