mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-11-28 04:59:52 +01:00
弹框 wrapper 居中样式移到全局作用域
scoped 块里的 ::v-deep .el-dialog__wrapper 同样打不到 element-ui 自渲染的 wrapper,跟 .v-modal 一起挪到 global.scss。
This commit is contained in:
parent
c14fe17741
commit
1722d89efa
2 changed files with 11 additions and 11 deletions
|
|
@ -138,15 +138,7 @@ export default {
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
/* 弹框垂直居中:element-ui 把 .el-dialog__wrapper 渲染到 body 上,需要 deep 选择器穿透 */
|
/* 大档与小档通过 .custom-dialog--large 区分 */
|
||||||
::v-deep .el-dialog__wrapper.custom-dialog {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
overflow: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 内部 .el-dialog 也带 custom-dialog class(来自 customClass prop),用于区分大小档 */
|
|
||||||
::v-deep .el-dialog.custom-dialog {
|
::v-deep .el-dialog.custom-dialog {
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
|
@ -259,7 +251,7 @@ export default {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* size="large":dialog 上下各留 10px 让边框和圆角可见,但仍占满大部分浏览器高度 */
|
/* 大档:上下各留 10px 让边框和圆角可见 */
|
||||||
::v-deep .el-dialog.custom-dialog.custom-dialog--large {
|
::v-deep .el-dialog.custom-dialog.custom-dialog--large {
|
||||||
margin: 10px auto !important;
|
margin: 10px auto !important;
|
||||||
height: calc(100vh - 20px);
|
height: calc(100vh - 20px);
|
||||||
|
|
|
||||||
|
|
@ -50,8 +50,16 @@ select:-webkit-autofill:focus {
|
||||||
--dialog-table-max: 1280px;
|
--dialog-table-max: 1280px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 全局弹框遮罩:脱离 dialog wrapper 层级,需全局生效 */
|
/* 全局弹框遮罩 */
|
||||||
.v-modal {
|
.v-modal {
|
||||||
background: rgba(15, 23, 42, 0.55) !important;
|
background: rgba(15, 23, 42, 0.55) !important;
|
||||||
backdrop-filter: blur(2px);
|
backdrop-filter: blur(2px);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 全局弹框 wrapper 居中 */
|
||||||
|
.el-dialog__wrapper.custom-dialog {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
overflow: auto;
|
||||||
}
|
}
|
||||||
Loading…
Reference in a new issue