style: 添加tags弹出动画

This commit is contained in:
xiaoxian521
2021-08-02 12:57:57 +08:00
parent c260f88e38
commit 74ef4e1722
6 changed files with 28 additions and 19 deletions

View File

@@ -34,7 +34,7 @@
<ul
v-show="visible"
:style="{ left: buttonLeft + 'px', top: buttonTop + 'px' }"
class="contextmenu"
class="contextmenu animate__animated animate__flipInX"
>
<div
v-for="(item, key) in tagsViews"
@@ -70,8 +70,9 @@
:divided="item.divided"
:disabled="item.disabled"
@click="onClickDrop(key, item)"
>{{ item.text }}</el-dropdown-item
>
{{ item.text }}
</el-dropdown-item>
</el-dropdown-menu>
</template>
</el-dropdown>
@@ -306,7 +307,12 @@ export default {
onClickDrop(key, {}, currentSelect.value);
}
function closeMenu() {
visible.value = false;
}
function openMenu(tag, e) {
closeMenu();
if (tag.path === "/welcome") {
// 右键菜单为首页,只显示刷新
Array.from([1, 2, 3]).forEach(v => {
@@ -343,11 +349,11 @@ export default {
buttonLeft.value = left;
}
buttonTop.value = e.clientY;
visible.value = true;
}
function closeMenu() {
visible.value = false;
nextTick(() => {
setTimeout(() => {
visible.value = true;
}, 50);
});
}
// 鼠标移入
@@ -515,6 +521,8 @@ export default {
font-size: 12px;
font-weight: 400;
color: #333;
outline: 0;
box-shadow: 0 2px 8px rgb(0 0 0 / 15%);
li {
width: 100%;
margin: 0;