2014-07-16 97 views

回答

0

您並不需要將您的整個模板保存在{% raw %}容器中;你可以混合使用:

{% raw %} 
{{#accordion-component}} 
    {{#accordion-item isActive=true title="Foo Bar"}} 
{% endraw %} 
    This is text in an accordion, with a 
    <a href="{{ url_for('blah') }}">link elsewhere</a>. 
{% raw %} 
    {{/accordion-item}} 
    {{#accordion-item title="Bar Baz"}} 
    Anim pariatur cliche reprehenderit... 
    {{/accordion-item}} 
{{/accordion-component}} 
{% endraw %} 

你也可以有選擇地插入角度方括號內的指令;以下是原始部分:

{{ '{{' }}#popover-link-component tagName="button" 
    class="btn btn-primary" title="{{ popover_title }}" 
    content="{{ popover_content }}" {{ '}}' }} 
    {{ 
{{ '{{/popover-link-component}}' }} 

這裏{{..}}角度圍繞酥料餅組件支架由Jinja2的指令插入時,結束標記是一個串內插。