refactor: 优化当 loop 为空数组时, 判断为有 loop 配置

This commit is contained in:
lihao.ylh 2022-02-28 16:40:08 +08:00 committed by lianjie.lj
parent 72098d6550
commit 77d837c010

View File

@ -501,7 +501,7 @@ export class Node<Schema extends NodeSchema = NodeSchema> {
} }
/** /**
* has loop when 1. loop is validArray with length > 1 ; OR 2. loop is variable object * has loop when 1. loop is valid array ; OR 2. loop is variable object
* @return boolean, has loop config or not * @return boolean, has loop config or not
*/ */
hasLoop() { hasLoop() {
@ -510,7 +510,7 @@ export class Node<Schema extends NodeSchema = NodeSchema> {
return false; return false;
} }
if (Array.isArray(value) && value.length > 0) { if (Array.isArray(value)) {
return true; return true;
} }
if (isJSExpression(value)) { if (isJSExpression(value)) {