bue
bue copied to clipboard
Update compile.js
如果是空白文本内容,如:
<div>
</div>
这样,那么不需要做一次parseText
@henryzp 你说得对。不过,把这段代码
//如果是空白节点则不做处理
+ if(/^\s+$/.test(node.nodeValue)){
+ return;
+ }
直接放在switch case里面,个人认为会降低代码可读性。 我觉得把他放到_compileTextNodeh函数的开头会更好些,你觉得呢?
@youngwind ,认同。。。