-
Notifications
You must be signed in to change notification settings - Fork 150
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# How to deal with line-break | ||
|
||
## Problem Description | ||
|
||
How to handle newline character `\n` in VTable? | ||
|
||
## solution | ||
|
||
Line breaks are not parsed by default in VTable and will be drawn as a space in canvas. You can enable newline parsing by configuring `enableLineBreak: true`. At this time, the newline characters in the string will be parsed into newlines, and the string will be parsed into multiple lines. | ||
|
||
``` | ||
const option = { | ||
//...... | ||
enableLineBreak: true, | ||
} | ||
``` | ||
|
||
## Related documents | ||
|
||
- [Tutorial](https://www.visactor.io/vtable/option/ListTable#enableLineBreak) | ||
- [github](https://github.com/VisActor/VTable) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# 怎么处理换行符 | ||
|
||
## 问题描述 | ||
|
||
如何在VTable中处理换行符`\n`? | ||
|
||
## 解决方案 | ||
|
||
在 VTable 中默认不会解析换行符,在canvas中会被绘制为一个空格。可以通过配置`enableLineBreak: true`来开启换行符解析,此时字符串中换行符会被解析为换行,字符串会被解析为多行。 | ||
|
||
``` | ||
const option = { | ||
// ...... | ||
enableLineBreak: true, | ||
} | ||
``` | ||
|
||
## 相关文档 | ||
|
||
- [教程](https://www.visactor.io/vtable/option/ListTable#enableLineBreak) | ||
- [github](https://github.com/VisActor/VTable) |