Vue实现字符串换行

今天在做的时候需要用到字符串换行,在网上找了一下,换行是通过添加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就可以换行了

你可能感兴趣的:(笔记,vue.js,javascript,elementui)