v-if的问题

为什么第一个按钮的判断不通过,但第二个按钮的条件是满足的,结果第二个按钮也不显示了。只有第一个按钮条件满足了,才会显示第二个按钮

       <el-table-column label="操作" align="center">
          <template slot-scope="scope">
            <button class="green-btn see" v-if="scope.row.status == 0" @click="flushStatus(scope.row,scope.$index)">刷新状态</button>
            <button class="green-btn see" v-if="scope.row.port" @click="caramDetailview(scope.$index,scope.row)">查看</button>
          </template>
        </el-table-column>
阅读 1.7k
2 个回答

1.slot-scope="{row,index}"
2.slot=""也写下,columnsd定义的

浏览器控制台看下数据,确认一下status的值

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题