实现弹框方式主要是LayerLink
、OverlayEntry
,具体实现方式网上有很多类似代码,本文主要记录一下“弹框组件CompositedTransformFollower
”相对于“触发弹框组件CompositedTransformTarget
”的对齐方式,对齐方式主要取决于CompositedTransformFollower
组件的两个参数:targetAnchor
、followerAnchor
对齐方式如下(12中对齐方式主要参考elementui 的 tooltip 组件):
targetAnchor
、followerAnchor
对应参数如下:
// targetAnchor、followerAnchor 默认值为 topLeft
// 左上
// followerAnchor: Alignment.topRight,
// 左中
// targetAnchor: Alignment.centerLeft,
// followerAnchor: Alignment.centerRight,
// 左下
// targetAnchor: Alignment.bottomLeft,
// followerAnchor: Alignment.bottomRight,
// 右上
// targetAnchor: Alignment.topRight,
// 右中
// targetAnchor: Alignment.centerRight,
// followerAnchor: Alignment.centerLeft,
// 右下
// targetAnchor: Alignment.bottomRight,
// followerAnchor: Alignment.bottomLeft,
// 上左
// targetAnchor: Alignment.topLeft,
// followerAnchor: Alignment.bottomLeft,
// 上中
// targetAnchor: Alignment.topCenter,
// followerAnchor: Alignment.bottomCenter,
// 上右
// targetAnchor: Alignment.topRight,
// followerAnchor: Alignment.bottomRight,
// 下左
// targetAnchor: Alignment.bottomLeft,
// followerAnchor: Alignment.topLeft,
// 下中
// targetAnchor: Alignment.bottomCenter,
// followerAnchor: Alignment.topCenter,
// 下右
// targetAnchor: Alignment.bottomRight,
// followerAnchor: Alignment.topRight,
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。