From 9de02894623f3241d2f3abd0fe25c3b0cc2489eb Mon Sep 17 00:00:00 2001 From: jiayuqi7813 <63686458+jiayuqi7813@users.noreply.github.com> Date: Sun, 10 Jul 2022 19:58:35 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=AC=E5=91=8A=E7=AE=A1=E7=90=86=E5=AE=8C?= =?UTF-8?q?=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/admin/notification.vue | 31 +++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/src/components/admin/notification.vue b/src/components/admin/notification.vue index bee8a09..cf7dd1f 100644 --- a/src/components/admin/notification.vue +++ b/src/components/admin/notification.vue @@ -3,8 +3,18 @@ 添加公告 - -

特色

+ + + + + + + + + + 提交 + @@ -34,6 +44,10 @@ import { reactive, ref } from 'vue' export default { data(){ return{ + formData:{ + title:'', + content:'', + }, data:[], dialogTableVisible:false, } @@ -53,6 +67,19 @@ export default { }) }, methods:{ + submitNotice(){ + axios.post('/api/v1/admin/notice',this.formData).then(res => { + if (res.data.code === 200) { + this.dialogTableVisible = false; + ElNotification.success({ + title: '成功', + message: '添加成功', + duration: 2000 + }); + window.location.reload() + } + }) + }, handleClick(row){ axios.delete('/api/v1/admin/notice/'+row.id).then(res => { if (res.data.code === 200) {