小白一个《flask web开发》刚看到第三章,发现一个问题:
调用flask-moment时
base.html文件中的{{% block scripts %}}
如果放在{{% block content %}}外面
index文件继承base.html并且重写{% block scripts %}
时间就不会显示
如果scripts放在content里面,并且重写content的话就会显示
请问这是为什么呢?
我刚开始以为在bootstrap的base.html中,scripts是在content里的,但是源码是这样的:
请问到底是为啥呀?求大神们棒棒菜鸟。
你的
index.html
继承了base.html
并且重新定义了block scripts
如果你想要使用base.html
当中的block scripts
, 那么index.html
要这样写