【问题标题】:More than one variable on javascriptjavascript上的多个变量
【发布时间】:2018-12-16 19:25:21
【问题描述】:

我有这个脚本:

 <v-tab :title="siteObject.xip_infos[index].lineid" >
   <div class="description text-left" :class="{ 'text-danger': item.status === 'DEACTIVE' }">
     <small v-for="(field, key) in item" :key="key">
       <strong>{{ key }}</strong> {{ field }}<br>
     </small>
   </div>
 </v-tab>

此脚本的结果显示所有项目的状态为 DEACTIVE。 我想添加条件断开连接。我该怎么做?

【问题讨论】:

  • 我不知道为什么会有大量的投票。也许您需要显示预期的输出?
  • @mplungjan wen 已停用,输出将变为红色

标签: javascript vue.js


【解决方案1】:

大家好,我找到了答案

<v-tab :title="siteObject.xip_infos[index].lineid">
  <div class="description text-left" 
  :class="{ 'text-danger': item.status === 'DEACTIVE' || item.status === 'DISCONNECTED'  }">
    <small v-for="(field, key) in item" :key="key">
      <strong>{{ key }}</strong> {{ field }}<br>
    </small>
  </div>
</v-tab>

【讨论】:

  • 这是您问题的答案吗?如果是这样,请在答案中提及这一点
【解决方案2】:

你的意思可能是这样的:

<v-tab :title="siteObject.xip_infos[index].lineid" >
  <div class="description text-left" 
    :class="{ 'text-danger': item.status === 'DEACTIVE' || item.disconnected == true }">
     <small v-for="(field, key) in item" :key="key">
       <strong>{{ key }}</strong> {{ field }}<br>
     </small>
   </div>
</v-tab>

【讨论】:

  • 像什么是“我要添加条件断开连接。”?是“断开连接”的属性吗?
  • 它现在可以使用:
  • 好吧 :)
猜你喜欢
相关资源
最近更新 更多
热门标签