參考Stack Over flow的答案,使用Flask-JSGlue.
在html中引入
{{ JSGlue.include() }}
設置html中img的src=Flask.url_for('static', {'filename':'/your/images/path/and/name'})
這樣,自己隨便寫一個js函數或者調用jquery就可以實現切換靜態(tài)圖片了。
參考Stack Over flow的答案,使用Flask-JSGlue.
在html中引入
{{ JSGlue.include() }}
設置html中img的src=Flask.url_for('static', {'filename':'/your/images/path/and/name'})
這樣,自己隨便寫一個js函數或者調用jquery就可以實現切換靜態(tài)圖片了。