Vue.js(读音 /vjuː/, 类似于 view) 是一套构建用户界面的渐进式框架。Vue 只关注视图层, 采用自底向上增量开发的设计。
Vue项目初始化
使用vue-cli工具
| 
					 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23  | 
						$ npm install -g vue-cli // vue-cli installed globally $ vue init webpack project_name // init project ? Project name project_name // 项目名称 ? Project description A Vue.js project // Project description ? Author NathanYang // author ? Vue build standalone  //  ? Install vue-router? Yes  //  ? Use ESLint to lint your code? Yes  // Not recommendated ? Pick an ESLint preset Standard ? Setup unit tests with Karma + Mocha? No ? Setup e2e tests with Nightwatch? No // end2end    vue-cli · Generated "project_name".    To get started:      cd first-test-vue      npm install      npm run dev    Documentation can be found at https://vuejs-templates.github.io/webpack  | 
					
目录结构,等参考:https://www.jianshu.com/p/45b5ce2ab1c5
工具
使用FastAPI等后端,建议使用axios工具
| 
					 1  | 
						npm install axios -S  | 
					
快速构建UI,可使用ElementUI
| 
					 1  | 
						npm install element-ui -S  | 
					
前端展示PDF
| 
					 1  | 
						npm install vue-pdf -S  | 
					
参考:https://www.jianshu.com/p/6464eee4d0c1
-g, -s等后缀区别
| 
					 1 2 3 4 5  | 
						npm i module_name  -S  = >  npm install module_name --save    写入到 dependencies 对象 npm i module_name  -D  => npm install module_name --save-dev   写入到 devDependencies 对象 npm i module_name  -g  全局安装  | 
					
参考:https://www.cnblogs.com/web-record/p/10904907.html
运行
| 
					 1 2 3 4 5 6 7 8 9 10 11  | 
						# install dependencies npm install # serve with hot reload at localhost:8080 npm run dev # build for production with minification npm run build # build for production and view the bundle analyzer report npm run build --report  | 
					
其他
后端建议采用fastapi配合前端,其中fastapi要编写跨域请求。
例子
https://github.com/xyjigsaw/easy_label
更多内容访问 [omegaxyz.com](https://omegaxyz.com/)
网站所有代码采用Apache 2.0授权
网站文章采用知识共享许可协议BY-NC-SA4.0授权
© 2021 • OmegaXYZ-版权所有 转载请注明出处





