// 函数示例 @function px2rem($px) { $rem: 14px; @return ($px/$rem) + rem; } @mixin dropdown-menu($width:auto, $min-width:auto, $submenu-min-width:auto) { z-index: 2050; /* 没有这行则 抽屉无法显示右键菜单 */ width: $width; min-width: $min-width !important; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12), 0 0 6px rgba(0, 0, 0, 0.04), 0 2px 8px rgba(0, 0, 0, 0.15); background: #fff; border-radius: 4px; .ant-dropdown-menu { padding: 8px 0; border-radius: 4px; .ant-dropdown-menu-item { line-height: 25px; margin: 0; padding: 0 16px; font-size: 13px; outline: 0; display: flex; align-items: center; transition: 0.2s; border-bottom: 1px solid transparent; color: #606266 !important; background: #fff; .ant-dropdown-menu-title-content { width: 100%; } .menu-item-wrap { display: flex; flex-wrap: wrap; align-items: center; width: 100%; padding: 0 !important; .ant-input { width: 40px; height: 24px; margin: 0 5px; line-height: 1.4; padding: 1px 3px !important; font-size: 12px; text-align: center; } .ant-input-number { width: 40px; margin: 0 5px; font-size: 12px; vertical-align: middle; &.is-percent { width: 60px; } .ant-input-number-input-wrap { height: 24px; .ant-input-number-input { height: 100%; font-size: 12px; vertical-align: top; padding: 0 16px 0 0; text-align: center; } } .ant-input-number-handler-wrap { width: 16px; opacity: 1; &:hover { .ant-input-number-handler { height: 50%; } } .ant-input-number-handler-down { display: flex; align-items: center; justify-content: center; &:hover { height: 50% !important; } .ant-input-number-handler-down-inner { position: static; margin-top: 0; } } .ant-input-number-handler-up { display: flex; align-items: center; justify-content: center; &:hover { height: 50% !important; } .ant-input-number-handler-up-inner { position: static; margin-top: 0; } } } } } &:hover { background: #ecf5ff; color: #409eff !important; .iconfont { color: #409eff; } } &-disabled { color: #c0c4cc !important; &:hover { background: #fff; color: #c0c4cc !important; .iconfont { color: #c0c4cc !important; } } } .iconfont { display: inline-block; width: 14px; font-size: 13px; margin-right: 8px; } } } .ant-dropdown-menu-submenu { &-disabled { .ant-dropdown-menu-submenu-title { color: #c0c4cc !important; &:hover { background: #fff; color: #c0c4cc !important; .iconfont { color: #c0c4cc !important; } .ant-dropdown-menu-submenu-arrow-icon { color: #c0c4cc !important; } } .ant-dropdown-menu-submenu-arrow-icon { color: #c0c4cc !important; } } } &-title { line-height: 32px; margin: 0; outline: 0; padding: 0 16px !important; display: flex; align-items: center; font-size: 13px; color: #606266 !important; border-bottom: 1px solid transparent; transition: 0.2s; background: #fff; &:hover { background: #ecf5ff; color: #409eff !important; .iconfont { color: #409eff; } .ant-dropdown-menu-submenu-arrow-icon { color: #409eff !important; } } .iconfont { display: inline-block; width: 14px; font-size: 13px; margin-right: 8px; } .ant-dropdown-menu-submenu-arrow { &-icon { display: flex; align-items: center; margin-top: 1px; width: 14px; height: 14px; > svg { display: none; } &::after { font-family: 'iconfont'; content: '\e605'; font-size: 18px; } font-size: 14px; font-weight: 800; color: #606266 !important; } } } > .ant-dropdown-menu-submenu-content { box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12), 0 0 6px rgba(0, 0, 0, 0.04), 0 2px 8px rgba(0, 0, 0, 0.15); } } .ant-dropdown-menu-submenu-popup { min-width: $submenu-min-width; .ant-dropdown-menu-sub { margin: 0; } } .ant-dropdown-menu-item-divider { margin: 0; } }