该项目使用Flask作为后端提供api,使用vue构建前端页面
python==3.8.2
Flask==1.1.2
Flask-Cors==3.0.8
-
安装vue相关:
$ npm install -g @vue/[email protected] $ npm install [email protected] --save $ npm install [email protected] --save $ npm install [email protected] --save
-
创建vue app:
$ npm create vue
设置:
Vue CLI v3.7.0 ? Please pick a preset: Manually select features ? Check the features needed for your project: Babel, Router, Linter ? Use history mode for router? Yes ? Pick a linter / formatter config: Airbnb ? Pick additional lint features: Lint on save ? Where do you prefer placing config for Babel, PostCSS, ESLint, etc.? In package.json ? Save this as a preset for future projects? (y/N) No
-
启动项目:
$ python app.py # server目录下 $ npm run serve # client目录下
https://testdriven.io/blog/developing-a-single-page-app-with-flask-and-vuejs/