Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
bdc
/
bdcdj-web
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
929f6d7c
authored
2023-03-03 15:16:30 +0800
by
yangwei
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
选项卡右键优化
1 parent
7ddda7cb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
16 deletions
src/layout/components/TagsView/index.vue
src/layout/components/TagsView/index.vue
View file @
929f6d7
...
...
@@ -10,10 +10,10 @@
</router-link>
</scroll-pane>
<ul
v-show=
"visible"
:style=
"
{left:left+'px',top:top+'px'}" class="contextmenu">
<li
@
click=
"refreshSelectedTag(selectedTag)"
>
Refresh
</li>
<li
v-if=
"!isAffix(selectedTag)"
@
click=
"closeSelectedTag(selectedTag)"
>
Close
</li>
<li
@
click=
"closeOthersTags"
>
Close Others
</li>
<li
@
click=
"closeAllTags(selectedTag)"
>
Close All
</li>
<li
@
click=
"refreshSelectedTag(selectedTag)"
>
刷新
</li>
<li
v-if=
"!isAffix(selectedTag)"
@
click=
"closeSelectedTag(selectedTag)"
>
关闭
</li>
<li
@
click=
"closeOthersTags"
>
关闭其他
</li>
<li
@
click=
"closeAllTags(selectedTag)"
>
关闭所有
</li>
</ul>
</div>
</
template
>
...
...
@@ -164,18 +164,17 @@ export default {
}
},
openMenu
(
tag
,
e
)
{
const
menuMinWidth
=
105
const
offsetLeft
=
this
.
$el
.
getBoundingClientRect
().
left
// container margin left
const
offsetWidth
=
this
.
$el
.
offsetWidth
// container width
const
maxLeft
=
offsetWidth
-
menuMinWidth
// left boundary
const
left
=
e
.
clientX
-
offsetLeft
+
15
// 15: margin right
if
(
left
>
maxLeft
)
{
this
.
left
=
maxLeft
}
else
{
this
.
left
=
left
}
// const menuMinWidth = 105
// const offsetLeft = this.$el.getBoundingClientRect().left // container margin left
// const offsetWidth = this.$el.offsetWidth // container width
// const maxLeft = offsetWidth - menuMinWidth // left boundary
// const left = e.clientX - offsetLeft + 15 // 15: margin right
// if (left > maxLeft) {
// this.left = maxLeft
// } else {
// this.left = left
// }
this
.
left
=
e
.
clientX
this
.
top
=
e
.
clientY
this
.
visible
=
true
this
.
selectedTag
=
tag
...
...
Please
register
or
sign in
to post a comment