From 8c1f667abd7521d76aa5d9eba4277bee6cd39dc4 Mon Sep 17 00:00:00 2001 From: MyFaith Date: Tue, 9 Apr 2019 00:02:57 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=86=E7=B1=BB=20=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=20=E6=96=B0=E5=A2=9E=20=E5=88=A0=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/category.js | 15 +++++++++ src/views/post/CategoryList.vue | 60 +++++++++++++++++++++++++++++---- 2 files changed, 69 insertions(+), 6 deletions(-) diff --git a/src/api/category.js b/src/api/category.js index aac5441d..398715a8 100644 --- a/src/api/category.js +++ b/src/api/category.js @@ -11,4 +11,19 @@ categoryApi.listAll = () => { }) } +categoryApi.create = (category) => { + return service({ + url: baseUrl, + data: category, + method: 'post' + }) +} + +categoryApi.delete = categoryId => { + return service({ + url: `${baseUrl}/${categoryId}`, + method: 'delete' + }) +} + export default categoryApi diff --git a/src/views/post/CategoryList.vue b/src/views/post/CategoryList.vue index 6e3d2a32..72976bbb 100644 --- a/src/views/post/CategoryList.vue +++ b/src/views/post/CategoryList.vue @@ -11,10 +11,10 @@ - + - + @@ -22,10 +22,10 @@ - + - 保存 + 保存 @@ -38,7 +38,23 @@ :xs="24" :style="{ 'padding-bottom': '12px' }"> - + + + {{ text }} + + + 编辑 + + + 删除 + + + @@ -46,6 +62,8 @@