-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
当把一个组件放在最 template 最顶层的时候,会覆盖接下来所有的元素 #123
Comments
因为在顶层就是components的情况下,编译会直接报错,最后为了fix这个问题加了这个判断。 |
成立的。 <Panel/>
<Panel2/> 这样子的 source 传给 domParser 的时候,由于没有一个唯一的顶层元素,所以 parser 把 Panel 当成了顶层元素。 所以我想是不是可以在编译的时候,给 template 加一个顶层元素 <xml>
<Panel/>
<Panel2/>
</xml> 让其正常编译,在写入到 wxml 的时候再去掉这个顶层元素? |
xmldom在处理删除节点的时候比较麻烦,我暂时还没想到好的办法。这个问题后面我再调试一下看看。 |
发布的1.5.3 版本已修复这个问题 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
具体表现:

【正常情况】
【覆盖:第一个Panel能正常编译出来,第二个Panel直接消失】

我尝试着修复这个 bug,定位到了 wepy-cli\src\compile-template.js@465 这里,猜测是因为这个判断导致了这样子的bug,但是不清楚为何这里要做一个顶层元素的判断,还请 repo 主解答一下

The text was updated successfully, but these errors were encountered: