Update edit.js
This commit is contained in:
parent
a43e84ab65
commit
073da1c556
|
@ -213,6 +213,7 @@ export default class add extends React.Component{
|
||||||
addNewkey(){
|
addNewkey(){
|
||||||
let step = "step2-" + this.state.keys.length
|
let step = "step2-" + this.state.keys.length
|
||||||
this.state.keys.push(step)
|
this.state.keys.push(step)
|
||||||
|
this.setState({keys:this.state.keys})
|
||||||
}
|
}
|
||||||
|
|
||||||
onPhoneChange(e){
|
onPhoneChange(e){
|
||||||
|
@ -229,9 +230,7 @@ export default class add extends React.Component{
|
||||||
closeStep(index){
|
closeStep(index){
|
||||||
|
|
||||||
|
|
||||||
_.remove(this.state.keys, (n)=>{
|
this.state.keys[index] = ""
|
||||||
return n == this.state.keys[index];
|
|
||||||
});
|
|
||||||
|
|
||||||
this.setState({keys:this.state.keys})
|
this.setState({keys:this.state.keys})
|
||||||
console.log(this.state.keys)
|
console.log(this.state.keys)
|
||||||
|
@ -347,7 +346,7 @@ export default class add extends React.Component{
|
||||||
<div className="plan-title">key</div>
|
<div className="plan-title">key</div>
|
||||||
{
|
{
|
||||||
this.state.keys.map((item,index) => {
|
this.state.keys.map((item,index) => {
|
||||||
return(
|
return item ? (
|
||||||
<Card style={{ width:'100%',height:"auto","margin-bottom":"10px" }} title={this.state.step2_pagetitle} action={
|
<Card style={{ width:'100%',height:"auto","margin-bottom":"10px" }} title={this.state.step2_pagetitle} action={
|
||||||
index > 0 ?
|
index > 0 ?
|
||||||
( <span className="zent-link" target="_blank" onClick={(e)=>{ this.closeStep(index)} }>
|
( <span className="zent-link" target="_blank" onClick={(e)=>{ this.closeStep(index)} }>
|
||||||
|
@ -359,7 +358,7 @@ export default class add extends React.Component{
|
||||||
|
|
||||||
<Step2 ref={"step2-"+ index} addNewkey ={()=>{this.addNewkey()}} data={item} disabled={this.state.disabled} />
|
<Step2 ref={"step2-"+ index} addNewkey ={()=>{this.addNewkey()}} data={item} disabled={this.state.disabled} />
|
||||||
</Card>
|
</Card>
|
||||||
)
|
) : null
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue