From 4891e472c0d3b0cbb704a3297249931805a74c18 Mon Sep 17 00:00:00 2001 From: zhangbingce Date: Mon, 27 Sep 2021 14:32:16 +0800 Subject: [PATCH] fix error log in media query--lts Signed-off-by: zhangbingce --- runtime/main/model/compiler.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/runtime/main/model/compiler.ts b/runtime/main/model/compiler.ts index 8f6e1781..614746fd 100644 --- a/runtime/main/model/compiler.ts +++ b/runtime/main/model/compiler.ts @@ -407,7 +407,10 @@ function compileCustomComponent( */ function resetElementStyle(vm: Vm, element: Element): void { // Add judgment statements to avoid repeatedly calling 'setClass' function. - const len = element.children.length; + let len = 0; + if (element.children !== undefined) { + len = element.children.length; + } const css = vm.css || {}; const mqArr = css['@MEDIA']; for (let ii = 0; ii < len; ii++) {