fix: update css2json and fix #7

修复页面卡死问题(#7)
This commit is contained in:
yanglbme 2019-12-29 11:10:53 +08:00
parent 5aa280d949
commit 983e635192

View File

@ -57,7 +57,7 @@ function css2json(css) {
// 初始化返回值
let json = {};
while (css.length > 0) {
while (css.length > 0 && (css.indexOf('{') !== -1) && (css.indexOf('}') !== -1)) {
// 存储第一个左/右花括号的下标
const lbracket = css.indexOf('{');
const rbracket = css.indexOf('}');