企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
模板页面,可以利用插槽的方式,等待其他页面继承并填入 ```html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <link rel="stylesheet" href="/node_modules/bootstrap/dist/css/bootstrap.css"> {{block 'head'}}{{/block}} <title>Document</title> </head> <body> {{include './header.html'}} <!-- 插槽 --> {{block 'content'}} <h1>默认内容</h1> {{/block}} {{include './footer.html'}} <script src="/node_modules/jquery/dist/jquery.js"></script> <script src="/node_modules/bootstrap/dist/js/bootstrap.js"></script> {{block 'script'}}{{/block}} </body> </html> ``` index.html 继承 layout.html ```html {{extend './layout.html'}} {{block 'head'}} <style> body { background-color: cadetblue; } </style> {{/block}} {{block 'content'}} <div> <h1>index 页面填坑内容</h1> </div> {{/block}} {{block 'script'}} <script> console.log(1); </script> {{/block}} ```