赞
踩
jumpDetails(item) {
if (item.lightStatus === 'red') {
this.nowA1.status = 2
}
if (item.lightStatus === 'yellow') {
this.nowA1.status = 3
}
if (item.lightStatus === 'green') {
this.nowA1.status = 1
}
this.nowA1.display = 'one'
this.close = true
this.dialogVisible = true
}
jumpDetails(item) { switch (item.lightStatus) { case 'red': this.nowA1.status = 2 break case 'yellow': this.nowA1.status = 3 break case 'green': this.nowA1.status = 1 break default: return } this.nowA1.display = 'one' this.close = true this.dialogVisible = true }
jumpDetails(item) {
const value = item.lightStatus
console.log(item)
// 使用对象
const obj = {
'red': 2,
'yellow': 3,
'green': 1
}
this.nowA1.status = obj[value] ? obj[value] : ''
this.nowA1.display = 'one'
this.close = true
this.dialogVisible = true
}
```
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。