想用node.js+express写网站,网站头部一样,首页没有footer,其他几页都有,那我这个网站视图要分几个文件,用户点击切换时如何渲染每个页面?
It depends on your needs, you can
头部 + 主体 + footer or 头部 + footer
Use templates to configure required content, such as ejs, etc.
Or you can choose a single-page application and use routing to control rendering.
If you use ejs, make a header and footer file, and include the header and footer in each page as needed. For example:
<%- include header %> <!-- 主要内容区 --> <%- include footer%>
It depends on your needs, you can
Use templates to configure required content, such as ejs, etc.
Or you can choose a single-page application and use routing to control rendering.
If you use ejs, make a header and footer file, and include the header and footer in each page as needed.
For example: