Flask, Vue.JS 개발 팁

2018. 9. 18. 20:35서버 프로그래밍

Vue.JS에서 라우팅 하는 방법

http://blog.jeonghwan.net/2018/04/07/vue-router.html


vue-chartjs 사용 방법

https://www.npmjs.com/package/vue-chartjs

https://vue-chartjs.org/#/home


v-show를 이용한 동적 show/hidden 처리

https://forum.vuejs.org/t/v-show-in-template/14391


Flask에서 Static Folder 지정 방법

https://stackoverflow.com/questions/20646822/how-to-serve-static-files-in-flask

pp = Flask(__name__,
            static_url_path='', 
            static_folder='web/static',
            template_folder='web/templates')
  • static_url_path='' removes any preceding path from the URL (i.e. the default /static).
  • static_folder='web/static' will tell Flask serve the files found at web/static.
  • template_folder='web/templates', similarly, this changes the templates folder.
@app.route('/')
def root():
    return app.send_static_file('index.html')