fix: 修复分辨率过小时,单词被拆开的问题
This commit is contained in:
@@ -61,7 +61,11 @@ body {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 单词换行不被拆开
|
// 表头单词换行不被拆开
|
||||||
.el-table .cell {
|
.el-table th > .cell {
|
||||||
word-break: keep-all !important;
|
word-break: keep-all !important;
|
||||||
}
|
}
|
||||||
|
// 表格内容换行,不对中文生效,避免中文出现省略号
|
||||||
|
.el-table .cell {
|
||||||
|
word-break: break-word !important;
|
||||||
|
}
|
||||||
|
|||||||
@@ -92,6 +92,7 @@ export default {
|
|||||||
}, {
|
}, {
|
||||||
label: this.$t('overall.type'),
|
label: this.$t('overall.type'),
|
||||||
prop: 'tagType',
|
prop: 'tagType',
|
||||||
|
minWidth: 80,
|
||||||
show: true
|
show: true
|
||||||
}, {
|
}, {
|
||||||
label: this.$t('overall.remark'),
|
label: this.$t('overall.remark'),
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
list.forEach((item, index) => {
|
list.forEach((item, index) => {
|
||||||
if (item.label) {
|
if (item.label && item.label !== 'IP') {
|
||||||
let tempLength = 0
|
let tempLength = 0
|
||||||
|
|
||||||
if (item.label.indexOf(' ') > -1) {
|
if (item.label.indexOf(' ') > -1) {
|
||||||
@@ -72,20 +72,22 @@ export default {
|
|||||||
// 为了避免没有minWidth这种情况
|
// 为了避免没有minWidth这种情况
|
||||||
if (!item.minWidth) {
|
if (!item.minWidth) {
|
||||||
item.minWidth = newWidth
|
item.minWidth = newWidth
|
||||||
} else if (item.minWidth < newWidth) {
|
|
||||||
item.minWidth = newWidth
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 排序最后一位一般是'操作',或者是较长的字符,故不让其换行,宽度直接为字符宽度
|
// 排序最后一位一般是'操作',或者是较长的字符,故不让其换行,宽度直接为字符宽度
|
||||||
if (index === list.length - 1) {
|
if (index === list.length - 1) {
|
||||||
item.minWidth = (num * item.label.length) + 22
|
item.minWidth = (num * item.label.length) + 22
|
||||||
item.width = (num * item.label.length) + 22
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 有排序的,额外添加24px的排序图标宽度
|
// 有排序的,额外添加24px的排序图标宽度
|
||||||
if (item.sortable) {
|
if (item.sortable) {
|
||||||
item.minWidth = item.minWidth + 30
|
item.minWidth = item.minWidth + 30
|
||||||
item.width = item.width + 30
|
}
|
||||||
|
|
||||||
|
if (item.minWidth < newWidth) {
|
||||||
|
item.minWidth = newWidth
|
||||||
|
} else if (item.width < item.minWidth) {
|
||||||
|
item.width = item.minWidth
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user