全局自适应以及表格横向拖动优化
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
@import './variables.scss';
|
||||
@import './variables.scss';
|
||||
@import './mixin.scss';
|
||||
@import './transition.scss';
|
||||
@import './element-ui.scss';
|
||||
@@ -41,6 +41,37 @@ html {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
/* ================= 全局自适应加固 =================
|
||||
与 src/utils/adaptive.js 的视口等比缩放配合,
|
||||
兜底避免极端情况下出现页面级横向溢出与内容崩塌。 */
|
||||
html,
|
||||
body {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
body {
|
||||
/* 禁止页面级横向滚动,防止因个别固定宽度元素把整页撑破;
|
||||
表格自身的横向滚动由 el-table 内部滚动容器承担,不受影响 */
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
/* 弹性布局子项允许收缩,避免 flex 容器被子项固有宽度撑破 */
|
||||
#app,
|
||||
.app-wrapper,
|
||||
.main-container,
|
||||
.lower-container {
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
/* 通用长文本换行,避免 url/数字/英文长串将布局撑破 */
|
||||
a,
|
||||
.el-button,
|
||||
.el-table .cell,
|
||||
.el-form-item__content,
|
||||
.el-form-item__label {
|
||||
word-break: break-word;
|
||||
}
|
||||
|
||||
*,
|
||||
*:before,
|
||||
*:after {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/**
|
||||
/**
|
||||
* 通用css样式布局处理
|
||||
* Copyright (c) 2019 roomroot
|
||||
*/
|
||||
@@ -93,6 +93,11 @@
|
||||
}
|
||||
|
||||
.el-table {
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
|
||||
.el-table__header-wrapper, .el-table__fixed-header-wrapper {
|
||||
th {
|
||||
word-break: break-word;
|
||||
@@ -108,6 +113,20 @@
|
||||
margin-left: 1px;
|
||||
}
|
||||
}
|
||||
|
||||
// 表格横向拖拽滚动:拖拽过程中光标切换为“抓手”
|
||||
.el-table__body-wrapper.is-dragging,
|
||||
.el-table__fixed-body-wrapper.is-dragging {
|
||||
cursor: grabbing;
|
||||
}
|
||||
}
|
||||
|
||||
/* 原生表格同样禁止选中文本,避免横向滑动/滚动时误触发复制前的文本选中 */
|
||||
table {
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
/** 表单布局 **/
|
||||
|
||||
Reference in New Issue
Block a user