diff --git a/.changeset/red-stingrays-drive.md b/.changeset/red-stingrays-drive.md new file mode 100644 index 000000000000..b430f346bc38 --- /dev/null +++ b/.changeset/red-stingrays-drive.md @@ -0,0 +1,6 @@ +--- +'@modern-js/devtools-client': patch +--- + +feat(devtools): set z-index to avoid be covered +feat(devtools): 设置 z-index 以避免被覆盖 diff --git a/packages/devtools/client/src/entries/mount/index.module.scss b/packages/devtools/client/src/entries/mount/index.module.scss new file mode 100644 index 000000000000..9251f8c28b18 --- /dev/null +++ b/packages/devtools/client/src/entries/mount/index.module.scss @@ -0,0 +1,4 @@ +.container { + position: relative; + z-index: 9999; +} \ No newline at end of file diff --git a/packages/devtools/client/src/entries/mount/index.tsx b/packages/devtools/client/src/entries/mount/index.tsx index c1dbb08e0eaa..814dbd493974 100644 --- a/packages/devtools/client/src/entries/mount/index.tsx +++ b/packages/devtools/client/src/entries/mount/index.tsx @@ -3,10 +3,15 @@ import { parseQuery } from 'ufo'; import _ from 'lodash'; import { SetupClientParams } from '@modern-js/devtools-kit'; import { waitClientConnection } from './rpc'; +import styles from './index.module.scss'; import { DevtoolsActionButton } from '@/components/Devtools/Action'; // @ts-expect-error -const { container, resourceQuery } = window._modern_js_devtools_app; +const { container, resourceQuery } = window._modern_js_devtools_app as { + container: HTMLDivElement; + resourceQuery: string; +}; +container.classList.add(styles.container); const root = createRoot(container); const parsed = parseQuery(resourceQuery); if (