本文介绍了Aurelia:自动关闭的require元素不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么Aurelia无法处理自动闭合的require元素?

Why can't Aurelia deal with self-closing require elements?

例如:

<require from="component"></require>有效

<require from="component"/>不起作用

没有给出错误,但是如果您尝试使用自动关闭元素,则整个模板将失败.

No error is given, yet the entire template will fail if you try to use the self-closing element.

推荐答案

根据HTML规范,只有几个(仅具有开始标记的元素),它们是:

According to the HTML specification, there are just a few void elements (elements that only have a start tag), which are:

https://www.w3.org/TR/html5/syntax.html#void -元素.

Aurelia使用浏览器的本机DOMParser,这意味着它遵循相同的标准集.

Aurelia uses the browser's native DOMParser, which means it follows the same set of standards.

这篇关于Aurelia:自动关闭的require元素不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-29 05:12
查看更多