This commit is contained in:
oneao committed 2025-09-09 21:39:29 +08:00
1 parent 0172becffb
commit b547c12390
2 files changed
+34 -10

No files matched your search

@@ -12,26 +12,50 @@ $popup-prefix: '#{$prefix}-popup';
border-radius: 2px; border-radius: 2px;
z-index: 1000; z-index: 1000;
box-sizing: border-box; box-sizing: border-box;
box-shadow: $shadow-popup;
text-align: center; text-align: center;
&-arrow { &-arrow {
position: absolute; position: absolute;
width: 8px; width: 8px;
height: 8px; height: 8px;
z-index: 1; z-index: 1;
&::before { &::before {
position: absolute;
content: ''; content: '';
width: 8px; position: absolute;
height: 8px; inset: 0;
background: $bg-color-container;
transform: rotate(45deg); transform: rotate(45deg);
// background: $bg-color-container; transform-origin: center;
background: red;
box-sizing: border-box;
margin: 0;
padding: 0;
} }
} }
// 上方弹出,阴影主方向靠下(轻微),边缘明显
&[data-popup-placement^='top'] {
box-shadow:
0 4px 8px rgba(0, 0, 0, 0.06),
0 0 4px rgba(0, 0, 0, 0.12); //
}
// 下方弹出,阴影主方向靠上,边缘明显
&[data-popup-placement^='bottom'] {
box-shadow:
0 -4px 8px rgba(0, 0, 0, 0.06),
0 0 4px rgba(0, 0, 0, 0.12);
}
// 左侧弹出,阴影主方向靠右,边缘明显
&[data-popup-placement^='left'] {
box-shadow:
4px 0 8px rgba(0, 0, 0, 0.06),
0 0 4px rgba(0, 0, 0, 0.12);
}
// 右侧弹出,阴影主方向靠左,边缘明显
&[data-popup-placement^='right'] {
box-shadow:
-4px 0 8px rgba(0, 0, 0, 0.06),
0 0 4px rgba(0, 0, 0, 0.12);
}
// 上方弹出,箭头在底部 // 上方弹出,箭头在底部
&[data-popup-placement^='top'] > &-arrow { &[data-popup-placement^='top'] > &-arrow {
bottom: -4px; bottom: -4px;
@@ -262,7 +262,7 @@ export default defineComponent({
> >
{slots.content ? slots.content() : props.content} {slots.content ? slots.content() : props.content}
{props.showArrow && ( {props.showArrow && (
<div <span
class={`${prefixCls}-arrow`} class={`${prefixCls}-arrow`}
ref={arrowRef} ref={arrowRef}
style={{ style={{