亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

element怎么隱藏某一列中的一項按鈕?

element怎么隱藏某一列中的一項按鈕?

喵喵時光機 2018-08-23 17:03:55
如圖:想把前兩個刪除按鈕隱藏,但是最后一個不隱藏,頁面結構如下怎么寫?      <el-table-column label="操作" width="200%">         <template scope="scope">           <el-button size="small" @click="handleEdit(scope.$index, scope.row)">分配菜單</el-button>           <el-button size="small" type="danger" @click="handleDelete(scope.$index, scope.row)">刪除</el-button>         </template>       </el-table-column>
查看完整描述

1 回答

?
慕俠2389804

TA貢獻1719條經驗 獲得超6個贊

這個按鈕的顯隱也直接綁定在data里面,在button上面用v-show="scope.row.allowDelete控制


補充:

你的表單數據應該是類似的結構

let tableData = [
    {        name:"123",        number:123,
    },
    {        name:"456",        number:456,
    }
]

你可以將其補充為

let tableData = [
    {        name:"123",        number:123,        allowDelete:true,
    },
    {        name:"456",        number:456,        allowDelete:false,
    }]

然后在slot里,<button v-show="scope.row.allowDelete">刪除</button>


查看完整回答
反對 回復 2018-08-26
  • 1 回答
  • 0 關注
  • 4353 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號