Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ant-design-pro-vue
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
tianzhuanghu
ant-design-pro-vue
Commits
c2c977f6
Commit
c2c977f6
authored
Feb 27, 2019
by
kokoroli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:MultiTab close methods
parent
a9b9614c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
15 deletions
+14
-15
MultiTab.vue
src/components/MultiTab/MultiTab.vue
+14
-15
No files found.
src/components/MultiTab/MultiTab.vue
View file @
c2c977f6
...
...
@@ -43,7 +43,6 @@ export default {
},
methods
:
{
onEdit
(
targetKey
,
action
)
{
console
.
log
(
'onEdit'
,
targetKey
,
action
)
this
[
action
](
targetKey
)
},
remove
(
targetKey
)
{
...
...
@@ -60,30 +59,33 @@ export default {
// content menu
closeThat
(
e
)
{
console
.
log
(
'close that'
,
e
)
this
.
remove
(
e
)
},
closeLeft
(
e
)
{
// TODO
console
.
log
(
'close left'
,
e
)
const
index
=
this
.
fullPathList
.
indexOf
(
e
)
if
(
index
>
0
)
{
this
.
remove
(
this
.
fullPathList
[
index
-
1
])
const
currentIndex
=
this
.
fullPathList
.
indexOf
(
e
)
if
(
currentIndex
>
0
)
{
this
.
fullPathList
.
forEach
((
item
,
index
)
=>
{
if
(
index
<
currentIndex
)
{
this
.
remove
(
item
)
}
})
}
else
{
this
.
$message
.
info
(
'左侧没有标签'
)
}
},
closeRight
(
e
)
{
console
.
log
(
'close right'
,
e
)
const
index
=
this
.
fullPathList
.
indexOf
(
e
)
if
(
index
<
(
this
.
fullPathList
.
length
-
1
))
{
this
.
remove
(
this
.
fullPathList
[
index
+
1
])
const
currentIndex
=
this
.
fullPathList
.
indexOf
(
e
)
if
(
currentIndex
<
(
this
.
fullPathList
.
length
-
1
))
{
this
.
fullPathList
.
forEach
((
item
,
index
)
=>
{
if
(
index
>
currentIndex
)
{
this
.
remove
(
item
)
}
})
}
else
{
this
.
$message
.
info
(
'右侧没有标签'
)
}
},
closeAll
(
e
)
{
console
.
log
(
'close all'
,
e
)
const
currentIndex
=
this
.
fullPathList
.
indexOf
(
e
)
this
.
fullPathList
.
forEach
((
item
,
index
)
=>
{
if
(
index
!==
currentIndex
)
{
...
...
@@ -92,8 +94,6 @@ export default {
})
},
closeMenuClick
({
key
,
item
,
domEvent
})
{
console
.
log
(
'key'
,
key
)
console
.
log
(
'item'
,
item
.
$attrs
[
'data-vkey'
])
const
vkey
=
domEvent
.
target
.
getAttribute
(
'data-vkey'
)
switch
(
key
)
{
case
'close-right'
:
...
...
@@ -141,7 +141,6 @@ export default {
}
},
activeKey
:
function
(
newPathKey
)
{
console
.
log
(
'activeKey'
,
newPathKey
)
this
.
$router
.
push
({
path
:
newPathKey
})
}
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment