Vue实现字符串换行 Wh1T3ZzT 2023-02-14 852 阅读1分钟 今天在做的时候需要用到字符串换行,在网上找了一下,换行是通过添加white-space: pre-wrap属性,通过\n进行换行 在这里记录一下 <style lang="scss" scoped> ::v-deep .el-table th.el-table__cell > .cell{ white-space: pre-wrap; font-size: 12px; } </style> 使用的时候直接\n就可以换行了