Skip to content

Commit

Permalink
feat: recover flip prop
Browse files Browse the repository at this point in the history
  • Loading branch information
unknown committed Nov 29, 2021
1 parent 806e746 commit 61e23fb
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/popover/demos/enUS/flip.demo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Adjust the popover

Use `flip` to decide whether to adjust, use `flipLevel` to decide the level of adjustment.

```html
<n-popover
trigger="click"
placement="bottom-start"
:flip="true"
:flip-level="1"
>
<template #trigger>
<n-button> Offset </n-button>
</template>
<span
>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!</span
>
</n-popover>
```
1 change: 1 addition & 0 deletions src/popover/demos/enUS/index.demo-entry.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 14 additions & 0 deletions src/popover/demos/zhCN/flip.demo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# 弹出信息的位置调整

使用 `flip` 决定是否调整,使用`flipLevel`决定调整等级

```html
<n-popover trigger="click" placement="bottom-start" :flip-level="2">
<template #trigger>
<n-button> 我要调整 </n-button>
</template>
<span
>默认等级1是在已有位置内调整,如若已有位置不满足还是被遮挡了,可以设置等级为2,会在同纬度进行适当偏移的。注意:如果弹出信息足够大,怎么偏移都是会被遮挡哦!</span
>
</n-popover>
```
1 change: 1 addition & 0 deletions src/popover/demos/zhCN/index.demo-entry.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Popover 在内容周围弹出一些隐藏的信息。Popover 里面没什么内

```demo
basic
flip
trigger
delay
no-arrow
Expand Down
1 change: 1 addition & 0 deletions src/popover/src/PopoverBody.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit 61e23fb

Please sign in to comment.