File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change 6
6
</el-button >
7
7
</el-badge >
8
8
9
- <el-dialog :visible.sync =" dialogTableVisible" title =" Error Log" width =" 80%" append-to-body >
9
+ <el-dialog :visible.sync =" dialogTableVisible" width =" 80%" append-to-body >
10
+ <div slot =" title" >
11
+ <span style =" padding-right : 10px ;" >Error Log</span >
12
+ <el-button size =" mini" type =" primary" icon =" el-icon-delete" @click =" clearAll" >Clear All</el-button >
13
+ </div >
10
14
<el-table :data =" errorLogs" border >
11
15
<el-table-column label =" Message" >
12
16
<template slot-scope="{row}">
@@ -54,6 +58,12 @@ export default {
54
58
errorLogs () {
55
59
return this .$store .getters .errorLogs
56
60
}
61
+ },
62
+ methods: {
63
+ clearAll () {
64
+ this .dialogTableVisible = false
65
+ this .$store .dispatch (' errorLog/clearErrorLog' )
66
+ }
57
67
}
58
68
}
59
69
</script >
Original file line number Diff line number Diff line change @@ -5,12 +5,18 @@ const state = {
5
5
const mutations = {
6
6
ADD_ERROR_LOG : ( state , log ) => {
7
7
state . logs . push ( log )
8
+ } ,
9
+ CLEAR_ERROR_LOG : ( state ) => {
10
+ state . logs . splice ( 0 )
8
11
}
9
12
}
10
13
11
14
const actions = {
12
15
addErrorLog ( { commit } , log ) {
13
16
commit ( 'ADD_ERROR_LOG' , log )
17
+ } ,
18
+ clearErrorLog ( { commit } ) {
19
+ commit ( 'CLEAR_ERROR_LOG' )
14
20
}
15
21
}
16
22
You can’t perform that action at this time.
0 commit comments