我想在“building”模板文字内有一个“glass”模板文字。
<script id="building" type="text/x-nunjucks-template">
{% for x in range(0, 5) %}
<a-entity template="src: building.template; type: handlebars" position="{{ x * 5 }} 0 0">
</a-entity>
{% endfor %}
</script>
<script id="glass" type="text/x-nunjucks-template">
{% for x in range(0, 5) %}
<a-entity template="src: glass.template; type: handlebars" position="{{ x }} 2 2">
</a-entity>
{% endfor %}
</script>
我知道它们需要在 .HTML 文件内运行 - 我只是想知道是否有解决办法,以便我可以拥有以下内容:
index.html -->building.template-->glass.template
谢谢
最佳答案
使用{% raw %}
。
{% raw %}
some nunjucks templating
{% endraw %}
并且它不会在外部模板上渲染。
关于javascript - 是否可以在 A 框架中的另一个 nunjuck 模板文字内创建一个 nunjuck 模板文字?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53524145/