鍍金池/ 問答/HTML/ vue element 如何根據(jù)表格參數(shù)狀態(tài)調(diào)用按鈕狀態(tài)

vue element 如何根據(jù)表格參數(shù)狀態(tài)調(diào)用按鈕狀態(tài)

我想根據(jù)表格中某一行記錄的狀態(tài)prop:enabledStatus是啟用時(shí),我的那一行操作按鈕的狀態(tài)變成禁用;
prop:enabledStatus是禁用時(shí),我的那一行操作按鈕的狀態(tài)變成啟用;根據(jù)判斷只出現(xiàn)一個(gè)狀態(tài)按鈕。怎么弄,求大神指點(diǎn)

clipboard.png

clipboard.png

clipboard.png

回答
編輯回答
生性
<Button type="primary"  v-if="item.enabledStatus == 0">啟用</Button>
<Button type="danger"  v-else>禁用</Button>
2018年3月22日 20:14
編輯回答
祉小皓
<Button type="primary"  v-if="scope.row.enabledStatus == 0">啟用</Button>
<Button type="danger"  v-else>禁用</Button>
2017年6月17日 09:03