@@ -936,6 +936,7 @@ ReactDOM.render(<Demo />, _mount_);
936
936
937
937
<!-- rehype:bgWhite=true&codeSandbox=true&codePen=true-->
938
938
``` jsx
939
+ import React from ' react' ;
939
940
import ReactDOM from ' react-dom' ;
940
941
import { Table , Button , Input , Select } from ' uiw' ;
941
942
@@ -1054,6 +1055,7 @@ ReactDOM.render(<Demo />, _mount_);
1054
1055
1055
1056
<!-- rehype:bgWhite=true&codeSandbox=true&codePen=true-->
1056
1057
``` jsx
1058
+ import React from ' react' ;
1057
1059
import ReactDOM from ' react-dom' ;
1058
1060
import { Table , Button , Input , Select , Form , Notify } from ' uiw' ;
1059
1061
@@ -1094,7 +1096,14 @@ const columns = (actived, setChange, fields) => {
1094
1096
< Button type= " danger" onClick= {()=> setChange ({})}> Cancel< / Button>
1095
1097
< / >
1096
1098
}
1097
- return < Button type= " primary" onClick= {()=> setChange (rowData)} disabled= {actived !== undefined && ! flag}> Edit< / Button>
1099
+ return < Button
1100
+ type= " primary"
1101
+ onClick= {(e )=> {
1102
+ e .preventDefault ();
1103
+ setChange (rowData)
1104
+ }}
1105
+ disabled= {actived !== undefined && ! flag}
1106
+ > Edit< / Button>
1098
1107
}
1099
1108
}
1100
1109
]
@@ -1148,17 +1157,11 @@ const Demo = () => {
1148
1157
children: < Select>
1149
1158
< Select .Option value= " 男" > 男< / Select .Option >
1150
1159
< Select .Option value= " 女" > 女< / Select .Option >
1151
- < / Select>
1160
+ < / Select>
1152
1161
}
1153
1162
}}
1154
1163
>
1155
- {({ fields, state, canSubmit }) => {
1156
- return (
1157
- < div>
1158
- < Table columns= {columns (id, setChange, fields)} data= {data} / >
1159
- < / div>
1160
- )
1161
- }}
1164
+ {({ fields }) => < Table columns= {columns (id, setChange, fields)} data= {data} / > }
1162
1165
< / Form>
1163
1166
};
1164
1167
ReactDOM .render (< Demo / > , _mount_);
0 commit comments