From 8ac66c6e5a4ca934321cbcbf7734a4ee3a7a568f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E1=84=8B=E1=85=B5=E1=84=8C=E1=85=B5=E1=86=AB=E1=84=89?= =?UTF-8?q?=E1=85=A5=E1=86=A8?= Date: Wed, 5 Feb 2020 16:24:17 +0900 Subject: [PATCH] me page --- src/front/src/pages/articles/List.vue | 4 ++ src/front/src/pages/articles/Write.vue | 5 ++- src/front/src/pages/me/Info.vue | 52 ++++++++++++++++++++++++++ src/front/src/routes/index.js | 5 +++ 4 files changed, 64 insertions(+), 2 deletions(-) create mode 100644 src/front/src/pages/me/Info.vue diff --git a/src/front/src/pages/articles/List.vue b/src/front/src/pages/articles/List.vue index 7d9be51..eb6a10d 100644 --- a/src/front/src/pages/articles/List.vue +++ b/src/front/src/pages/articles/List.vue @@ -16,6 +16,10 @@
+ +
+ My +
diff --git a/src/front/src/pages/articles/Write.vue b/src/front/src/pages/articles/Write.vue index 944d847..8d782e9 100644 --- a/src/front/src/pages/articles/Write.vue +++ b/src/front/src/pages/articles/Write.vue @@ -45,12 +45,13 @@ if (id) { try { - const result = await articleApi.getArticle(id); - const {title, content} = result.data; + const { data } = await articleApi.getArticle(id); + const {title, content} = data; this.title = title; this.content = content; this.isEdit = true; } catch (err) { + alert('문제가 발생하였습니다.'); console.log(err); } } diff --git a/src/front/src/pages/me/Info.vue b/src/front/src/pages/me/Info.vue new file mode 100644 index 0000000..7b7bd64 --- /dev/null +++ b/src/front/src/pages/me/Info.vue @@ -0,0 +1,52 @@ + + + + + \ No newline at end of file diff --git a/src/front/src/routes/index.js b/src/front/src/routes/index.js index 3fe1591..f583576 100644 --- a/src/front/src/routes/index.js +++ b/src/front/src/routes/index.js @@ -7,6 +7,7 @@ import Register from "../pages/auth/Register"; import Articles from "../pages/articles/List"; import WriteArticle from '../pages/articles/Write'; import DetailArticle from '../pages/articles/Detail'; +import Info from "../pages/me/Info"; Vue.use(VueRouter); @@ -38,6 +39,10 @@ export const router = new VueRouter({ path: '/articles/:id', name: 'DetailArticle', component: DetailArticle + }, + { + path: '/me', + component: Info } ] });