ElemeFE / ElemeFE/element-react
1.4.20版本在Table中Switch开关不能用, 默认的回调参数value一直等于当前开关状态:(
- Dominant language
- JavaScript
- Stars
- 2.8k
- Forks
- 435
- PR merge metrics
- No merged PRs in 30d
Description
## 先表个白
几个月前,由一个纯新人小白。开始接触react, 找到了element-ui作为自己的工具。虽然有些用法,还不是很熟悉,模块化啥的也写成了一堆垃圾。但是对于现在的自己已经很满足了···特别感谢饿了么诸位的辛勤付出。Bug, 作为一个tester肯定还是要提的。
## 机器环境
- 操作系统: macOs
- 版本: 10.13.2
- 浏览器版本: Chrome 67.0.3396.99
- element-react版本: 1.4.20
重现步骤:
1. 在Table的column中使用Switch组件;
2. 点击Switch控件
预期结果: 开关能正常关闭和开启
实际结果: 开关无法开启和关闭
备注: 回调函数中value=当前开关状态, 1.4.13版本是成功的:)
代码如下:
```javascript
import React, {Component} from 'react';
import {Switch, Table} from 'element-react';
class TestComponent extends Component {
constructor(props) {
super(props);
this.state = {
columns: [
{
label: "日期",
prop: "date",
width: 180
},
{
label: "姓名",
prop: "name",
width: 180
},
{
label: "地址",
render: () => {
return (
{
console.log(value);
}}
onColor="#13ce66"
offColor="#ff4949">
)
}
}
],
data: [{
date: '2016-05-02',
name: '王小虎',
}, {
date: '2016-05-04',
name: '王小虎',
}, {
date: '2016-05-01',
name: '王小虎',
}, {
date: '2016-05-03',
name: '王小虎',
}, {
date: '2016-05-02',
name: '王小虎',
}, {
date: '2016-05-04',
name: '王小虎',
}]
}
}
componentDidMount() {
}
render() {
return (
)
}
}
```
Contributor guide
Assessment
This issue has not been assessed yet.