728x90
Spring Boot & Vue.js 연동
Spring Boot & Vue.js 기본 연동 프로젝트
(springvue > images : HELP.md 에 필요한 이미지)
구조
- Front : Vue.js
- Backend : Spring Boot
기본 설치 목록
- Vue.js
- Vue-CLI
- Node.js
- Vue.js
프로젝트 생성순서
- Spring Boot 프로젝트 생성
- Vue.js 프로젝트 추가(현재는 vue2 설치)
<!-- ex) vue create front-vue --> vue create 'project name'
- springvue > vue-frontend > vue.config.js 파일 추가
module.exports = { // npm run build시 파일 생성위치 outputDir: "../src/main/resources/static", // index.html 생성위치 indexPath: "../static/index.html", // 내장된 was주소 (Port번호는 Spring Server.port와 같아야 한다.) devServer: { proxy: "http://localhost:8080", }, chainWebpack: (config) => { const svgRule = config.module.rule("svg"); svgRule.uses.clear(); svgRule.use("vue-svg-loader").loader("vue-svg-loader"); }, };
- vue project 이동 후 > npm run build
- spring server 실행
- vue 기본 화면 실행 성공
서버 통신
- axios (jquery ajax와 비슷하다)vue add axios
화면 꾸미기
- vuetiy
- vue add vuetify
- 필요시 vue template 설치
- npm i -D vue-svg-loader vue-template-compiler
728x90
'FrontEnd > Vue' 카테고리의 다른 글
Vue.js Module (0) | 2023.04.15 |
---|---|
Vue.js 프로젝트 생성 (0) | 2023.04.15 |
[Vue.js] Router 기초 (0) | 2023.04.15 |
[Vue.js] 컴포넌트 등록 (0) | 2023.04.15 |
Vue.js란? (0) | 2023.04.15 |