Board1.vue

김형우·2021년 12월 28일
0

vue.js

목록 보기
22/30

vue.config.js

// 백엔드 연동

module.exports = {
    devServer:{
        proxy : {
            // 반드시 vue를 재시작!
            // 백엔드의 http://localhost:3000 이
            // vue에서 url을 생략해서 사용 가능 하도록 설정
            '/board' : {
                target:'http://localhost:3000',
                changeOrigin : true,
                logLevel:'debug',
            }
        }
    }
}

게시글쓰기

methods : {
            async handleData() {
                const url = "/board/select";
                const headers = {"Content-Type":"application/json"};

                const response = await this.axios.get(
                    url, 
                    {params  : { page : this.page }},
                    {headers : headers}
                );
                console.log(response.data);
                if(response.data.status === 200){
                    this.ctnt = response.data.result;
                    this.total = response.data.total;
                }
            },
       } 
profile
The best

0개의 댓글