app.py
from flask_bootstrap import Bootstrap app = Flask('sayhello') bootstrap = Bootstrap(app)
index.html
<head> {{ bootstrap.load_css() }} {% from 'bootstrap/form.html' import render_form %} </head> <body> <div class="hello-form"> {{ render_form(form),action=request.full_path }} </div> ..... {{ bootstrap.load_js() }} </body>
bootstrap/form.html 中 render_form 宏的参数
method : post extra_classes : None role : form 表单role属性 form_type : basic bootstrap表单样式:basic,inline,horizontal button_type : secondary 按钮样式:info,primary,secondary,danger,warning,success,light,dark id : action :
bootstrap/form.html 中的宏:
render_field() render_form() render_pager() render_pagination() render_nav_item(): nav render_breadcrumb_item() : 面包屑
moment.js时间格式
image.png