nf-action
Action groups that move overflow items into a dropdown or popover.
Import the components below; see the package README for standalone installation.
Dynamic dropdown mode
Loading example…
Dynamic dropdown mode
Dynamic popover mode
Loading example…
Dynamic popover mode
Automatic folding by width
Loading example…
Automatic folding by width
Attribute
| parameters | Description | Type | Optional value | Default value |
|---|---|---|---|---|
| mode | displayed mode | string | dropdown/popover | 'dropdown' |
| unique | The key of the component loop. If there is no loop, it does not need to be passed. | number/string | — | 0 |
| span | The upper limit of the number of child elements that triggers the drop-down; span=0 is calculated based on the available width; when span is exceeded, span−1 operations and one more entry are displayed. | number | — | 3 |
| trigger | The behavior that triggers the drop-down | string | hover/click/focus/manual | 'hover' |
| tabindex | tabindex of dropdown component | number | — | 0 |
| hide-timeout | The delay of dropdown closing the drop-down menu (only valid when trigger is hover) | number | — | 150 |
| show-timeout | The delay of dropdown expansion drop-down menu (only valid when trigger is hover) | number | — | 250 |
| hide-on-click | Whether dropdown hides the menu after clicking the menu item | boolean | — | true |
| placement | popover drop-down position | string | top/top-start/top-end/bottom/bottom-start/bottom-end/left/left-start/left-end/right/right-start/right-end | 'bottom' |
| offset | The offset of where the popover appears | number | — | 0 |
| transition | Popover defines gradient animation | string | — | 'fade-in-linear' |
| popper-class | The custom class name of the popover popup layer. | string | — | — |
| popper-options | Popper 2 configuration of popover; the old version boundariesElement and gpuAcceleration need to be changed to modifiers. | Object | — | |
| open-delay | Popover display delay, in milliseconds; handled by Element Plus if not set. | number | — | 200 |
| close-delay | Popover hiding delay, in milliseconds. | number | — | 0 |
| visible-arrow | Whether the popover displays arrows. | boolean | — | true |
| width | popover elastic layer width. | string / number | — | auto |
Event
| event name | Description | callback parameters |
|---|---|---|
| show | Triggered when popover is displayed | — |
| after-enter | Triggered after the popover display animation is finished playing | — |
| hide | Triggered when popover is hidden | — |
| after-leave | Triggered after the popover hidden animation finishes playing | — |
| visible-change | Dropdown triggers when the drop-down box appears/hides | visible: boolean |
Slot
| Name | Description |
|---|---|
| default | action content |
Methods
| method name | Description | return value |
|---|---|---|
| refreshStyle() | Recalculated after layout changes. | Promise<void> |
| open() | Open the floating layer manually. | void |
| close() | Close the overlay manually. | void |
Instructions for use
Dynamic DOM child elements also support drop-down, such as buttons added or removed after permission control. The example shows the edit and import buttons after 5 seconds; the width example shows after 3 seconds. Each operation component is instantiated only once, and the floating layer moves the original node through Teleport.
