Tabs close
This commit is contained in:
1 parent
1d1c6fded2
commit
4db609dc78
1 file changed
+11
@@ -268,6 +268,17 @@ export default class Main extends Component {
|
|||||||
onChange={activeKey => {
|
onChange={activeKey => {
|
||||||
this.setState({ curPath: activeKey })
|
this.setState({ curPath: activeKey })
|
||||||
}}
|
}}
|
||||||
|
onEdit={(targetKey, action) => {
|
||||||
|
if (action == 'remove') {
|
||||||
|
const idx = filepaths.indexOf(targetKey as string);
|
||||||
|
if(idx < 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
filepaths.splice(idx, 1);
|
||||||
|
const nextPath = filepaths[idx - 1];
|
||||||
|
this.setState({ filepaths, curPath: nextPath });
|
||||||
|
}
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
{
|
{
|
||||||
filepaths.map(filepath => {
|
filepaths.map(filepath => {
|
||||||
|
|||||||
Reference in new issue
Block a user