我有两个 Marko 组件,每当它们在 Express 服务器上呈现时,我想将它们包含在其他组件中:<main-header/>和<main-footer />.
components/main-header/index.marko如下:
<lasso-page />
<!DOCTYPE html>
<html>
<head>
<lasso-head />
</head>
<body>
<nav>...</nav>
并且components/main-footer/index.marko是:
<footer>...</footer>
<lasso-body />
</body>
</html>
我想在特定路线上呈现的页面如下所示:
<main-header />
//component content
<main-footer />
但是,我得到一个错误Missing ending "body" tagfor main-header,所以显然这种 EJS-partials 像语法是不允许的。有没有更好的方法来做到这一点,而无需在每个路由处理程序index.marko中呈现单个文件?