三元表达

21 阅读1分钟
      <div v-if="item.onlineStatus == 1" class="realtime-singletitle " :class="[item.statusTypeId == 0        : item.statusTypeId == 1 ? 'abnormal'          : item.statusTypeId == 2 ? 'oran'            : item.statusTypeId == 3 ? 'arlm'              : item.statusTypeId == 6 ? 'shield'                : item.statusTypeId == 7 ? 'unknown'                  : '']">
        {{ item.statusTypeId | statusNameList }}
        {{ i.deviceValue + i.typeCode + " " }}
        {{ i.collectTime | formatDate }}
      </div>
      <div v-else-if="item.onlineStatus == 2 || item.onlineStatus == 3" class="realtime-singletitle "
        :class="[item.onlineStatus == 2 ? 'abnormal'          : item.onlineStatus == 3 ? 'unexcited' : '']">
        {{ item.onlineStatus | statusOnlie }}
        {{ i.deviceValue + i.typeCode + " " }}
        {{ i.collectTime | formatDate }}
      </div>
      
      
      onlineStatus1并且statusTypeId0是一个样式。   onlineStatus1并且statusTypeId2是一样样式