Update edit.js

This commit is contained in:
姜棚 2021-12-10 14:00:07 +08:00
parent a43e84ab65
commit 073da1c556
1 changed files with 4 additions and 5 deletions

View File

@ -213,6 +213,7 @@ export default class add extends React.Component{
addNewkey(){
let step = "step2-" + this.state.keys.length
this.state.keys.push(step)
this.setState({keys:this.state.keys})
}
onPhoneChange(e){
@ -229,9 +230,7 @@ export default class add extends React.Component{
closeStep(index){
_.remove(this.state.keys, (n)=>{
return n == this.state.keys[index];
});
this.state.keys[index] = ""
this.setState({keys: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>
{
this.state.keys.map((item,index) => {
return(
return item ? (
<Card style={{ width:'100%',height:"auto","margin-bottom":"10px" }} title={this.state.step2_pagetitle} action={
index > 0 ?
( <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} />
</Card>
)
) : null
})
}
</div>