-
-
Notifications
You must be signed in to change notification settings - Fork 225
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix picker multicolumn with same key bug
- Loading branch information
1 parent
3bae2ec
commit d72edb7
Showing
2 changed files
with
61 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import React, { Component } from 'react'; | ||
import Container from '../components/Container'; | ||
import Header from '../components/Header'; | ||
import Footer from '../components/Footer'; | ||
import { Picker } from '../../components'; | ||
import '../styles/pages/BadgePage'; | ||
|
||
class Page extends Component { | ||
state = { | ||
single:{} | ||
} | ||
render() { | ||
const {single} = this.state | ||
return ( | ||
<Container className="test"> | ||
<Header title="Test" /> | ||
<main> | ||
<Picker | ||
visible={single.visible} | ||
dataSource={[ | ||
{ | ||
idCardType: 1, | ||
idCardName: '身份证', | ||
}, | ||
{ | ||
idCardType: 2, | ||
idCardName: '护照', | ||
}, | ||
{ | ||
idCardType: 3, | ||
idCardName: '出生证', | ||
}, | ||
]} | ||
value={single.value} | ||
displayMember="idCardName" | ||
valueMember="idCardType" | ||
onOk={(value) => { | ||
console.log('pickerPage onOk ->', value); | ||
const _value = value.idCardType; | ||
single.value = _value; | ||
this.setState({ | ||
single, | ||
}); | ||
}} | ||
onCancel={() => { | ||
}} | ||
/> | ||
</main> | ||
<Footer /> | ||
</Container> | ||
); | ||
} | ||
} | ||
|
||
export default Page; |