簡體   English   中英

是否可以在A框架中的另一個nunjuck模板文字內部創建nunjuck模板文字?

[英]Is it possible to create a nunjuck template literal inside another nunjuck template literal in A-Frame?

我想在“建築”模板文字中包含“玻璃”模板文字。

<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 %}

而且它不會在外部模板上呈現。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM