最近一个项目需要 表格与seitch开关相结合 差了很多资料都是
v-model="scope.row.on"
on-value="1"
off-value="0"
这种用法,然后我实际并没有生效 应该是版本的问题吧,后来吧 1 0 改成了ture false 这次是好使的。但是控制台报了一大堆的警告。翻译一下 是on-value 已经改成了active-value 改了之后 没问题了 。完整代码:
<template slot-scope="scope">
<el-switch
v-model="scope.row.status"
:active-value= true
:inactive-value= false
disabled
>
</el-switch>
</template>
数据:
{"用户名称":"Role1","用户邮箱":"chenji@sina.cn","联系方式":"15011119087","创建人":"admin","创建时间":"2018-01-23 11:33:30","status":true},
{"用户名称":"Role1","用户邮箱":"chenji@sina.cn","联系方式":"15011119087","创建人":"admin","创建时间":"2018-01-23 11:33:30","status":false},
{"用户名称":"Role1","用户邮箱":"chenji@sina.cn","联系方式":"15011119087","创建人":"admin","创建时间":"2018-01-23 11:33:30","status":true},
{"用户名称":"Role1","用户邮箱":"chenji@sina.cn","联系方式":"15011119087","创建人":"admin","创建时间":"2018-01-23 11:33:30","status":false},
{"用户名称":"Role1","用户邮箱":"chenji@sina.cn","联系方式":"15011119087","创建人":"admin","创建时间":"2018-01-23 11:33:30","status":false},
{"用户名称":"Role1","用户邮箱":"chenji@sina.cn","联系方式":"15011119087","创建人":"admin","创建时间":"2018-01-23 11:33:30","status":true},
{"用户名称":"Role1","用户邮箱":"chenji@sina.cn","联系方式":"15011119087","创建人":"admin","创建时间":"2018-01-23 11:33:30","status":false},