简体   繁体   English

这个带有双花括号的 HTML 使用什么语言?

[英]What language is used in this HTML that has double curly braces?

What language is used in this HTML code that has double curly braces?在这个带有双花括号的 HTML 代码中使用了什么语言? ie {{}} I think it's not JavaScript.即 {{}} 我认为它不是 JavaScript。

<script id="todo-template" type="text/x-handlebars-template">

            <li {{#if completed}}class="completed"{{/if}} data-id="{{id}}">
                <div class="view">
                    <input class="toggle" type="checkbox" {{#if completed}}checked{{/if}}>
                    <button class="destroy"></button>
                </div>
                <input class="edit" value="{{title}}">
            </li>

        </script>
        <script id="footer-template" type="text/x-handlebars-template">
            <span class="todo-count"><strong>{{activeTodoCount}}</strong> {{activeTodoWord}} left</span>
            <ul class="filters">
                <li>
                    <a {{#eq filter 'all'}}class="selected"{{/eq}} href="#/all">All</a>
                </li>
                <li>
                    <a {{#eq filter 'active'}}class="selected"{{/eq}}href="#/active">Active</a>
                </li>
                <li>
                    <a {{#eq filter 'completed'}}class="selected"{{/eq}}href="#/completed">Completed</a>
                </li>
            </ul>
            {{#if completedTodos}}<button class="clear-completed">Clear completed</button>{{/if}}
        </script>
        <script src="node_modules/todomvc-common/base.js"></script>
        <script src="node_modules/jquery/dist/jquery.js"></script>
        <script src="node_modules/handlebars/dist/handlebars.js"></script>
        <script src="node_modules/director/build/director.js"></script>
        <script src="js/app.js"></script>
    </body>
</html>

这是一种称为 Handlebars 的模板语言: http : //handlebarsjs.com

It's handlebars https://www.npmjs.com/package/handlebars/ .这是车把https://www.npmjs.com/package/handlebars/ Handlebars allows templates to be precompiled and included as javascript code rather than the handlebars template allowing for faster startup time Handlebars 允许模板被预编译并包含为 javascript 代码,而不是允许更快的启动时间的 handlebars 模板

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM