- Notifications
You must be signed in to change notification settings - Fork8.4k
fix(ZIndex): 弹窗内vxe-table内组件的层级问题修复#7029
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
The head ref may contain hidden characters:"feature/\u5F39\u7A97\u5185vxe-table\u5185\u7EC4\u4EF6\u7684\u5C42\u7EA7\u95EE\u9898\u4FEE\u590D"
Uh oh!
There was an error while loading.Please reload this page.
Conversation
changeset-botbot commentedDec 17, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
|
coderabbitaibot commentedDec 17, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
WalkthroughAdds a new VXE CSS module that raises z-index for VXE tooltip wrappers and select panels, exports it from the styles package, and imports it into two bootstrap entry points to load the styles globally. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Suggested labels
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: defaults Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
Thanks for usingCodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (1)
packages/styles/src/vxe/index.css (1)
3-9:Consider scoping the rules to modal contexts.The current selectors apply globally to all
.vxe-tooltip--wrapperand.vxe-select--panelelements. For better precision and to avoid potential side effects, consider scoping these rules to modal/dialog contexts:-/** 弹窗内表格tooltip层级问题修复 */-.vxe-tooltip--wrapper {- z-index: 2001 !important;-}-/** 弹窗内表格组件层级问题修复 */-.vxe-select--panel {- z-index: 2001 !important;-}+/** 弹窗内表格tooltip层级问题修复 */+.ant-modal .vxe-tooltip--wrapper,+.vben-modal .vxe-tooltip--wrapper {+ z-index: 2001 !important;+}+/** 弹窗内表格组件层级问题修复 */+.ant-modal .vxe-select--panel,+.vben-modal .vxe-select--panel {+ z-index: 2001 !important;+}This approach ensures the fix only applies within modal contexts where the issue occurs.
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
apps/web-antd/src/bootstrap.ts(1 hunks)packages/styles/package.json(1 hunks)packages/styles/src/vxe/index.css(1 hunks)playground/src/bootstrap.ts(1 hunks)
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: mynetfanRepo: vbenjs/vue-vben-admin PR: 5397File: playground/src/bootstrap.ts:23-30Timestamp: 2025-01-15T04:29:13.944ZLearning: In the Vue-Vben-Admin project, commented code in bootstrap.ts showing modal and drawer configuration examples should be preserved as reference documentation, even after moving to CSS variables for z-index management.📚 Learning: 2025-01-15T04:29:13.944Z
Learnt from: mynetfanRepo: vbenjs/vue-vben-admin PR: 5397File: playground/src/bootstrap.ts:23-30Timestamp: 2025-01-15T04:29:13.944ZLearning: In the Vue-Vben-Admin project, commented code in bootstrap.ts showing modal and drawer configuration examples should be preserved as reference documentation, even after moving to CSS variables for z-index management.Applied to files:
packages/styles/src/vxe/index.cssapps/web-antd/src/bootstrap.tsplayground/src/bootstrap.ts
📚 Learning: 2024-11-05T10:34:13.846Z
Learnt from: ArthurDarkstoneRepo: vbenjs/vue-vben-admin PR: 4807File: docs/src/components/common-ui/vben-vxe-table.md:65-84Timestamp: 2024-11-05T10:34:13.846ZLearning: In `docs/src/components/common-ui/vben-vxe-table.md`, the code examples are provided within markdown scripts for documentation and do not require import statements or explicit type annotations.Applied to files:
apps/web-antd/src/bootstrap.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
- GitHub Check: post-update (ubuntu-latest)
- GitHub Check: post-update (windows-latest)
- GitHub Check: Check (windows-latest)
- GitHub Check: Test (windows-latest)
🔇 Additional comments (3)
packages/styles/package.json (1)
29-32:LGTM! Export structure is correct.The new export entry follows the existing pattern and correctly maps to the vxe CSS file.
apps/web-antd/src/bootstrap.ts (1)
9-9:LGTM! Consistent style import placement.The vxe styles import is correctly positioned with other global style imports at bootstrap time.
playground/src/bootstrap.ts (1)
9-9:LGTM! Consistent with web-antd bootstrap.The vxe styles import mirrors the change in
apps/web-antd/src/bootstrap.ts, ensuring consistent styling across different application entrypoints.
| .vxe-tooltip--wrapper { | ||
| z-index:2001!important; | ||
| } | ||
| /** 弹窗内表格组件层级问题修复 */ | ||
| .vxe-select--panel { | ||
| z-index:2001!important; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Verify the hardcoded z-index value aligns with modal z-index.
The CSS uses a hardcodedz-index: 2001 with!important to override vxe-table component defaults. While this addresses the immediate layering issue, consider:
- Hardcoded value: The z-index of 2001 should be verified against the actual modal z-index to ensure proper layering.
- Global scope: These rules apply to all vxe components globally, not just those within modals. This could have unintended effects on vxe components elsewhere in the application.
Run the following script to verify modal z-index values and check for existing z-index management patterns:
#!/bin/bash# Find modal/dialog z-index definitions and CSS variable patterns# Search for modal z-index configurationsecho"=== Modal/Dialog z-index configurations ==="rg -nP --type=ts --type=js -C3'modal.*z-?index|drawer.*z-?index|zIndex.*modal|zIndex.*drawer' -g'!node_modules' -g'!dist'# Search for CSS variables related to z-indexecho -e"\n=== CSS z-index variables ==="rg -nP --type=css --type=scss -C2'--.*z-?index|z-?index.*var\(' -g'!node_modules' -g'!dist'# Search for vxe-table z-index referencesecho -e"\n=== VXE-table z-index references ==="rg -nP -C3'vxe.*z-?index' -g'!node_modules' -g'!dist'
🤖 Prompt for AI Agents
In packages/styles/src/vxe/index.css around lines 3 to 9 the styles force aglobal z-index:2001 !important for vxe-tooltip--wrapper and vxe-select--panelwhich may conflict with modal stacking and affects all vxe components; run theprovided verification script to find existing modal/dialog z-index values andany CSS z-index variables, then replace the hardcoded value by scoping the rulesto the modal/dialog container (e.g. .modal .vxe-*) or using a CSS variable (e.g.z-index: var(--z-modal, 2001)) and remove !important so the modal z-indexcontrols stacking consistently; if multiple modal z-index values exist, choosethe variable to match the modal stack or set the vxe rules to compute relativeto the modal context (increase only when inside modal) to avoid global sideeffects.
Uh oh!
There was an error while loading.Please reload this page.
Description
默认的modal层级比vxe-table的组件层级高,会有如下问题


调整默认层级可以省去每次设置modal层级
Type of change
Please delete options that are not relevant.
pnpm-lock.yamlunless you introduce a new test example.Checklist
pnpm run docs:devcommand.pnpm test.feat:,fix:,perf:,docs:, orchore:.Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.