vue 数组中 下一行的标题如果和上一行一样,则不显示

  <div class="rf-item" v-for="(item,index) in airData" :key="index">
          <div v-if="index == 0" class="ri-left">{{item.device_name}}div>
          <div v-else class="ri-left">{{ nameText(airData[index-1].device_name,item.device_name) }}div>
          <div class="ri-middle">
            {{item.check_items}}
          div>
          <div class="ri-right">
            {{item.grade}}
          div>
        div>
  nameText(preName, thisName) {
      if (preName == thisName) {
        return "";
      }
      return thisName;
    },

你可能感兴趣的:(代码片段)