【问题标题】:How can I set a base template in Locomotive.js?如何在 Locomotive.js 中设置基本模板?
【发布时间】:2023-04-07 20:47:01
【问题描述】:

我不想在我的项目的每个视图上设置我的资产(CSS/JS、菜单等)。有没有办法设置一个基本模板,然后调用视图来填充它的主体?

例子:

<!-- my base template -->
<html>
    <head>
        <!-- my assets here -->
    </head>
    <body>
        <%= view.render() %> <!-- example of where I would render the views -->
    </body>
</html>

我该怎么做?

【问题讨论】:

    标签: html locomotivejs


    【解决方案1】:

    我已经看到 here 这样做了,但还没有看到它是如何工作的。另一种选择是使用 EJS 部分。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-06-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-01-02
      • 2021-09-25
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多