Skip to content

Commit

Permalink
feat: 把全局样式的类名挂载在document.body上
Browse files Browse the repository at this point in the history
  • Loading branch information
liuzejia authored and liuzejia committed Jul 4, 2024
1 parent 1abebaf commit d749aaa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/taro-router/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export function handleAppMount (config: SpaRouterConfig | MpaRouterConfig, _: Hi
isPosition = false
}
const appWrapper = (app?.parentNode || app?.parentElement || document.body) as HTMLElement
appWrapper.classList.add('taro-app-wrap')
document.body.classList.add('taro-app-wrap')
app.classList.add('taro_router')

if (!isPosition) appWrapper.appendChild(app)
Expand All @@ -35,7 +35,7 @@ export function handleAppMountWithTabbar (config: SpaRouterConfig | MpaRouterCon
isPosition = false
}
const appWrapper = (app?.parentNode || app?.parentElement || document.body) as HTMLElement
appWrapper.classList.add('taro-app-wrap')
document.body.classList.add('taro-app-wrap')

app.classList.add('taro_router')

Expand Down

0 comments on commit d749aaa

Please sign in to comment.