request task list every 5 seconds

This commit is contained in:
Marvin Zhang
2019-04-23 20:36:31 +08:00
parent 677d6e36a9
commit 71c5c6342d

View File

@@ -43,6 +43,12 @@ import {
export default {
name: 'TaskTableView',
data () {
return {
// setInterval handle
handle: undefined
}
},
props: {
title: String
},
@@ -71,6 +77,14 @@ export default {
this.$store.dispatch('node/getTaskList', this.$route.params.id)
}
}
},
mounted () {
this.handle = setInterval(() => {
this.onRefresh()
}, 5000)
},
destroyed () {
clearInterval(this.handle)
}
}
</script>