element icon indicating copy to clipboard operation
element copied to clipboard

ele V2.x建议增加<el-table> 嵌套<el-switch>元素的事件,表格列单个switch事件

Open EvanSole opened this issue 9 years ago • 6 comments

...
<el-table-column prop="isActive" label="是否可用"  min-width="130" sortable>
      <template scope="scope">
           <el-switch
                  v-model="scope.row.isActive"
                 on-color="#13ce66"
                 off-color="#ff4949"
                  @click.native.change="isActiveSwitch()">
           </el-switch>
        </template>
</el-table-column>
...

table列表里使用了一个标签,用来直接激活/取消激活用户,目前change事件无法传递当前行列的信息,滑动全列都触发.如果能单独在列表操作则更好一点.谢谢

EvanSole avatar Feb 24 '17 09:02 EvanSole

我也碰到个类似问题,你试下这样子: @change="handleSwitch(scope.$index, $event)"> handleSwitch(index, val){ ... } 我这边好像行了

qpxtWhite avatar Feb 24 '17 11:02 qpxtWhite

@click.native.change 这是什么用法?

Leopoldthecoder avatar Feb 25 '17 10:02 Leopoldthecoder

@Leopoldthecoder 原生事件

imac8t avatar Feb 25 '17 15:02 imac8t

谢谢 , @qpxtWhite 方法可行

EvanSole avatar Feb 27 '17 03:02 EvanSole

image

我的cstatus的值明明都是0啊 为啥打印出来都是1呢,这个问题怎么解决 @qpxtWhite

liliangali avatar May 24 '17 14:05 liliangali

@liliangali on-value off-value 是用数字0,1还是字符串0,1?如果是数字的,要这样用的:on-value和:off-value

AlenWang avatar Sep 22 '17 08:09 AlenWang