rev:手持功能代码优化
This commit is contained in:
@@ -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 => {
|
||||
|
||||
Reference in New Issue
Block a user