From 61e23fba72121583100295aa5510001346186da2 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 26 Nov 2021 14:35:24 +0800 Subject: [PATCH] feat: recover flip prop --- src/popover/demos/enUS/flip.demo.md | 22 ++++++++++++++++++++++ src/popover/demos/enUS/index.demo-entry.md | 1 + src/popover/demos/zhCN/flip.demo.md | 14 ++++++++++++++ src/popover/demos/zhCN/index.demo-entry.md | 1 + src/popover/src/PopoverBody.tsx | 1 + 5 files changed, 39 insertions(+) create mode 100644 src/popover/demos/enUS/flip.demo.md create mode 100644 src/popover/demos/zhCN/flip.demo.md diff --git a/src/popover/demos/enUS/flip.demo.md b/src/popover/demos/enUS/flip.demo.md new file mode 100644 index 00000000000..fd93c421a9c --- /dev/null +++ b/src/popover/demos/enUS/flip.demo.md @@ -0,0 +1,22 @@ +# Adjust the popover + +Use `flip` to decide whether to adjust, use `flipLevel` to decide the level of adjustment. + +```html + + + The default level 1 is to adjust within the existing position. If the + existing position is not satisfied, then you can set the level to 2, which + will be offset appropriately at the same latitude. Note: if the popover is + large enough, any offset will be blocked! + +``` diff --git a/src/popover/demos/enUS/index.demo-entry.md b/src/popover/demos/enUS/index.demo-entry.md index 8bdef43f5b9..0b85778ba68 100644 --- a/src/popover/demos/enUS/index.demo-entry.md +++ b/src/popover/demos/enUS/index.demo-entry.md @@ -8,6 +8,7 @@ If you just want to display some basic text message, see [Tooltip](tooltip) inst ```demo basic +flip trigger delay no-arrow diff --git a/src/popover/demos/zhCN/flip.demo.md b/src/popover/demos/zhCN/flip.demo.md new file mode 100644 index 00000000000..3245332168c --- /dev/null +++ b/src/popover/demos/zhCN/flip.demo.md @@ -0,0 +1,14 @@ +# 弹出信息的位置调整 + +使用 `flip` 决定是否调整,使用`flipLevel`决定调整等级 + +```html + + + 默认等级1是在已有位置内调整,如若已有位置不满足还是被遮挡了,可以设置等级为2,会在同纬度进行适当偏移的。注意:如果弹出信息足够大,怎么偏移都是会被遮挡哦! + +``` diff --git a/src/popover/demos/zhCN/index.demo-entry.md b/src/popover/demos/zhCN/index.demo-entry.md index 41dae147c5a..0737bf524cc 100644 --- a/src/popover/demos/zhCN/index.demo-entry.md +++ b/src/popover/demos/zhCN/index.demo-entry.md @@ -8,6 +8,7 @@ Popover 在内容周围弹出一些隐藏的信息。Popover 里面没什么内 ```demo basic +flip trigger delay no-arrow diff --git a/src/popover/src/PopoverBody.tsx b/src/popover/src/PopoverBody.tsx index 6f107975975..8f20054161a 100644 --- a/src/popover/src/PopoverBody.tsx +++ b/src/popover/src/PopoverBody.tsx @@ -305,6 +305,7 @@ export default defineComponent({ y: this.y, flip: this.flip, placement: this.placement, + flip: this.flip, flipLevel: this.flipLevel, containerClass: this.namespace, ref: 'followerRef',