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 66 </el-button >
77 </el-badge >
88
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 >
1014 <el-table :data =" errorLogs" border >
1115 <el-table-column label =" Message" >
1216 <template slot-scope="{row}">
@@ -54,6 +58,12 @@ export default {
5458 errorLogs () {
5559 return this .$store .getters .errorLogs
5660 }
61+ },
62+ methods: {
63+ clearAll () {
64+ this .dialogTableVisible = false
65+ this .$store .dispatch (' errorLog/clearErrorLog' )
66+ }
5767 }
5868}
5969 </script >
Original file line number Diff line number Diff line change @@ -5,12 +5,18 @@ const state = {
55const mutations = {
66 ADD_ERROR_LOG : ( state , log ) => {
77 state . logs . push ( log )
8+ } ,
9+ CLEAR_ERROR_LOG : ( state ) => {
10+ state . logs . splice ( 0 )
811 }
912}
1013
1114const actions = {
1215 addErrorLog ( { commit } , log ) {
1316 commit ( 'ADD_ERROR_LOG' , log )
17+ } ,
18+ clearErrorLog ( { commit } ) {
19+ commit ( 'CLEAR_ERROR_LOG' )
1420 }
1521}
1622
You can’t perform that action at this time.
0 commit comments