最近一個項目需要 表格與seitch開關(guān)相結(jié)合 差了很多資料都是
v-model="scope.row.on"
on-value="1"
off-value="0"
這種用法赠堵,然后我實際并沒有生效 應(yīng)該是版本的問題吧,后來吧 1 0 改成了ture false 這次是好使的。但是控制臺報了一大堆的警告兔综。翻譯一下 是on-value 已經(jīng)改成了active-value 改了之后 沒問題了 。完整代碼:
<template slot-scope="scope">
<el-switch
v-model="scope.row.status"
:active-value= true
:inactive-value= false
disabled
>
</el-switch>
</template>
數(shù)據(jù):
{"用戶名稱":"Role1","用戶郵箱":"chenji@sina.cn","聯(lián)系方式":"15011119087","創(chuàng)建人":"admin","創(chuàng)建時間":"2018-01-23 11:33:30","status":true},
{"用戶名稱":"Role1","用戶郵箱":"chenji@sina.cn","聯(lián)系方式":"15011119087","創(chuàng)建人":"admin","創(chuàng)建時間":"2018-01-23 11:33:30","status":false},
{"用戶名稱":"Role1","用戶郵箱":"chenji@sina.cn","聯(lián)系方式":"15011119087","創(chuàng)建人":"admin","創(chuàng)建時間":"2018-01-23 11:33:30","status":true},
{"用戶名稱":"Role1","用戶郵箱":"chenji@sina.cn","聯(lián)系方式":"15011119087","創(chuàng)建人":"admin","創(chuàng)建時間":"2018-01-23 11:33:30","status":false},
{"用戶名稱":"Role1","用戶郵箱":"chenji@sina.cn","聯(lián)系方式":"15011119087","創(chuàng)建人":"admin","創(chuàng)建時間":"2018-01-23 11:33:30","status":false},
{"用戶名稱":"Role1","用戶郵箱":"chenji@sina.cn","聯(lián)系方式":"15011119087","創(chuàng)建人":"admin","創(chuàng)建時間":"2018-01-23 11:33:30","status":true},
{"用戶名稱":"Role1","用戶郵箱":"chenji@sina.cn","聯(lián)系方式":"15011119087","創(chuàng)建人":"admin","創(chuàng)建時間":"2018-01-23 11:33:30","status":false},