feat:add context menu

This commit is contained in:
黄云飞
2021-12-18 20:00:18 +08:00
parent c87801cb5d
commit 80f671697d
15 changed files with 506 additions and 30 deletions
+76
View File
@@ -193,4 +193,80 @@
z-index: 9;
position: absolute;
border: 1px dotted #000000;
}
.contextmenu-container {
z-index: 9;
position: fixed;
display: none;
padding: 4px;
overflow-x: hidden;
overflow-y: auto;
background: #fff;
box-shadow: 0 2px 12px 0 rgb(56 56 56 / 20%);
border: 1px solid #e2e6ed;
border-radius: 2px;
}
.contextmenu-content {
display: flex;
flex-direction: column;
}
.contextmenu-content .contextmenu-sub-item::after {
position: absolute;
content: "";
width: 16px;
height: 16px;
right: 12px;
background: url(../images/submenu-dropdown.svg);
}
.contextmenu-content .contextmenu-item {
width: 180px;
padding: 0 32px 0 16px;
height: 30px;
display: flex;
align-items: center;
white-space: nowrap;
box-sizing: border-box;
cursor: pointer;
}
.contextmenu-content .contextmenu-item.hover {
background: rgba(25, 55, 88, .04);
}
.contextmenu-content .contextmenu-item span {
font-size: 12px;
color: #3d4757;
}
.contextmenu-content .contextmenu-item span.shortcut {
color: #767c85;
height: 30px;
flex: 1;
text-align: right;
line-height: 30px;
}
.contextmenu-content .contextmenu-item i {
width: 16px;
height: 16px;
vertical-align: middle;
display: inline-block;
background-repeat: no-repeat;
background-size: 100% 100%;
flex-shrink: 0;
margin-right: 8px;
}
.contextmenu-divider {
background-color: #e2e6ed;
margin: 4px 16px;
height: 1px;
}
.contextmenu-print {
background-image: url(../../assets/images/print.svg);
}
+1
View File
@@ -0,0 +1 @@
<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><g fill="#3D4757" fill-rule="evenodd"><path d="M12 4h-1V2H5v2H4V2a1 1 0 011-1h6a1 1 0 011 1v2zm0 5v4a1 1 0 01-1 1H5a1 1 0 01-1-1V9h1v4h6V9h1z"/><path d="M12 12v-1h2V5H2v6h2v1H2a1 1 0 01-1-1V5a1 1 0 011-1h12a1 1 0 011 1v6a1 1 0 01-1 1h-2z"/><path d="M3 8h10v1H3zm8-2h2v1h-2z"/></g></svg>

After

Width:  |  Height:  |  Size: 369 B

@@ -0,0 +1 @@
<svg width="16" height="16" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd"><path d="M0 0h16v16H0z"/><g fill="#767C85"><path d="M7 12.243l-.707-.707 4.243-4.243.707.707z"/><path d="M6.293 4.464L7 3.757 11.243 8l-.707.707z"/></g></g></svg>

After

Width:  |  Height:  |  Size: 260 B