局部更新和自动打开文档

This commit is contained in:
pixel
2020-10-12 12:06:00 +08:00
parent 63012b31ac
commit 51b6c1086e
6 changed files with 44 additions and 10 deletions
+6 -1
View File
@@ -138,6 +138,7 @@ export default {
name: "State",
data() {
return {
timer:null,
state: {},
colors: [
{ color: "#5cb87a", percentage: 20 },
@@ -148,10 +149,14 @@ export default {
},
created() {
this.reload();
setInterval(() => {
this.timer = setInterval(() => {
this.reload();
}, 1000*10);
},
beforeDestroy(){
clearInterval(this.timer)
this.timer = null
},
methods: {
async reload() {
const { data } = await getSystemState();