From 087fac8a527afc14d27d02a602a2b5708ee14023 Mon Sep 17 00:00:00 2001 From: Chorer Date: Mon, 9 Nov 2020 12:45:13 +0800 Subject: [PATCH] =?UTF-8?q?view.text=20=E8=BD=AC=E4=B8=BA=E5=AD=97?= =?UTF-8?q?=E7=AC=A6=E4=B8=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/pen.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pen.js b/lib/pen.js index 871cdc0..2cffdd5 100644 --- a/lib/pen.js +++ b/lib/pen.js @@ -204,7 +204,7 @@ export default class Painter { const paddings = this._doPaddings(view); switch (view.type) { case 'text': { - const textArray = view.text.split('\n'); + const textArray = String(view.text).split('\n'); // 处理多个连续的'\n' for (let i = 0; i < textArray.length; ++i) { if (textArray[i] === '') {