rev:手持功能代码优化

This commit is contained in:
2024-04-19 17:03:43 +08:00
parent 6766c47ced
commit fdb12b9760
7 changed files with 50 additions and 58 deletions

View File

@@ -153,7 +153,7 @@ export default {
const timer = setInterval(() => {
this.settime()// 你所加载数据的方法
this.getMessage()
}, 10000)
}, 1000)
// 销毁定时器
this.$once('hook:beforeDestroy', () => {
clearInterval(timer)
@@ -175,14 +175,6 @@ export default {
methods: {
changeDevice(val) {
this.device = val
deviceCrud.getLedMessage(this.device).then(data => {
this.form = data
})
// todo: 定时器
this.timer = setInterval(() => { // 定时刷新设备的状态信息
console.log('定时器启动')
this.initStatus()
}, 10000)
},
getMessage() {
deviceCrud.getLedMessage(this.device).then(data => {