1
0

feat(web): 优化折行的使用

This commit is contained in:
2024-12-01 11:47:23 +08:00
parent 6742565f97
commit be2971765e
2 changed files with 15 additions and 13 deletions

View File

@@ -179,20 +179,27 @@ export function timeField(field, label, width = 150) {
}
}
export function stringWrapField(field, label, width = undefined) {
return stringField(field, label, width, true)
}
/**
* @param {string} field
* @param {string} label
* @param {number} width
* @param {boolean} wrap
*/
export function stringField(field, label, width = undefined) {
export function stringField(field, label, width = undefined, wrap = false) {
let data = {
name: field,
label: label,
className: 'nowrap',
}
if (width) {
data['width'] = width
}
if (wrap) {
data['className'] = 'nowrap'
}
return data
}