getFlipPlacements
获取所有可能的翻转 Placement 数组。
函数签名
typescript
function getFlipPlacements(placement: Placement): Placement[]
type Placement =
| 'top' | 'top-start' | 'top-end'
| 'bottom' | 'bottom-start' | 'bottom-end'
| 'left' | 'left-start' | 'left-end'
| 'right' | 'right-start' | 'right-end'参数
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
placement | Placement | 是 | 原始定位方式 |
返回值
| 类型 | 说明 |
|---|---|
Placement[] | 所有可能的翻转 Placement 数组 |
工作原理
生成包含原始 Placement 和所有可能翻转位置的数组,用于弹出层位置自动调整。