luna-plus 0.0.16 → 0.0.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -175,7 +175,8 @@
|
|
|
175
175
|
|
|
176
176
|
// 计算箭头位置:根据 placement 和 trigger 宽度动态计算
|
|
177
177
|
const arrowPosition = $derived.by(() => {
|
|
178
|
-
|
|
178
|
+
// 依赖 visible 状态,确保在 dropdown 打开时重新计算
|
|
179
|
+
if (!visible || !triggerEl) return undefined;
|
|
179
180
|
const triggerWidth = triggerEl.offsetWidth;
|
|
180
181
|
const arrowOffset = Math.max(triggerWidth / 2, 12); // 最小 12px,居中于 trigger
|
|
181
182
|
|
|
@@ -186,11 +187,6 @@
|
|
|
186
187
|
}
|
|
187
188
|
return undefined;
|
|
188
189
|
});
|
|
189
|
-
|
|
190
|
-
// 箭头使用 left 还是 right
|
|
191
|
-
const arrowSide = $derived(
|
|
192
|
-
placement.endsWith("-end") ? "right" : placement.endsWith("-start") ? "left" : undefined
|
|
193
|
-
);
|
|
194
190
|
</script>
|
|
195
191
|
|
|
196
192
|
<div
|