<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??碼云GVP開源項目 12k star Uniapp+ElementUI 功能強大 支持多語言、二開方便! 廣告
                # 27 include標簽使用詳解 1. 這個標簽相當于是直接指定的模板中代碼復制粘貼到當前位置 2. "include"標簽,如果想要使用父模板中的變量,直接使用就可以了,不需要使用“with context” 3. “include”的路徑,也是跟"import"一樣,直接從"templates"根目錄下去找,不要以相對路徑去找 ```text 格式: {% include "url" %} ``` ```text app.py from flask import Flask, render_template app = Flask(__name__) app.config["TEMPLATES_AUTO_RELOAD"] = True @app.route('/') def hello_world(): return render_template("index.html") @app.route("/detail/") def detail(): return render_template("common/course_detail.html") if __name__ == '__main__': app.run() ``` ```text index.html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> </head> <body> <div> {% include "common/header.html" %} <div class="content"> 中簡的 </div> {% include "common/footer.html" %} </div> </body> </html> ``` ```text common/course_detail.html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> </head> <body> {% include "common/header.html" %} 詳情頁 {% include "common/footer.html" %} </body> </html> ``` ```text footer.html <footer> 這是底部的 </footer> ``` ```text header.html <style type="text/css"> .nav ul{ overflow:hidden; } .nav ul li{ float: left; margin: 0 20px; } </style> <nav class="nav"> <ul> <li>首頁</li> <li>課程詳情</li> <li>視頻教程</li> <li>關于我們</li> </ul> </nav> ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看