0

我们可以找到许多使用淘汰 ContainerLess 语法的示例和代码(即使我很难从他们的网站上找到合适的文档)。

我的第一个问题表述是“它是邪恶的吗?”,但我不得不承认我并没有真正了解它是如何工作的,以及它如何确保浏览器不会转换或只是删除/更改评论部分?

所以,我改变了我的问题:

它是如何工作的(预处理、预渲染……)?

(它是邪恶的吗?我不禁认为改变评论的性质是不好的方式)。

谢谢

4

1 回答 1

1

Containerless control flow works my scanning the comments for comments that start with ko, and provide valid bindings. It is not "evil" in the sense that it is inefficient or an antipattern, if that's what you were asking.

If you are really interested in knowing, here is the source code. It is pretty straightforward though. It scans for the comments, parses out the bindings, and then passes them to the standard binding handlers.

于 2012-12-03T16:41:26.170 回答