v-show过滤输出


给v-show绑定一个computed方法,如果是在嵌套v-for中,要使用methods:
<td v-for="(value,key) in item" @click="$_fly(item['经度'],item['纬度'])" v-show="checkID(key)">
    <input class="form-control input-sm" :disabled="checkDisable(index)" v-model="item[key]">
</td>
根据不同情况返回布尔值:
checkID: function (key) {
  if (key == 'id' || key == 'ID') {
    return false;
  } else {
    return true;
  }
}
原文地址:https://www.cnblogs.com/wangwg1994/p/9153053.html