SwipeCell
Intro
Used for cell components that can slide left and right to display operation buttons.
Install
Register component globally via app.use, refer to Component Registration for more registration ways.
Usage
Basic Usage
Custom Content
Before Close
API
Props
| Attribute |
Description |
Type |
Default |
| name |
Identifier of SwipeCell |
number | string |
- |
| left-width |
Width of the left swipe area |
number | string |
auto |
| right-width |
Width of the right swipe area |
number | string |
auto |
| before-close |
Callback function before close |
(args) => boolean | Promise |
- |
| disabled |
Whether to disabled swipe |
boolean |
false |
| stop-propagation |
Whether to stop touchmove event propagation |
boolean |
false |
Slots
| Name |
Description |
| default |
custom content |
| left |
content of left scrollable area |
| right |
content of right scrollabe area |
Events
| Event |
Description |
Arguments |
| click |
Emitted when SwipeCell is clicked |
position: 'left' | 'right' | 'cell' | 'outside' |
| open |
Emitted when SwipeCell is opened |
{ name: string | number, position: 'left' | 'right' } |
| close |
Emitted when SwipeCell is closed |
{ name: string | number, position: 'left' | 'right' | 'cell' | 'outside' } |
beforeClose Params
| Attribute |
Description |
Type |
| name |
Name |
string | number |
| position |
Click positon |
'left' | 'right' | 'cell' | 'outside' |
Methods
Use ref to get SwipeCell instance and call instance methods.
| Name |
Description |
Attribute |
Return value |
| open |
open SwipeCell |
position: left | right |
- |
| close |
close SwipeCell |
- |
- |
Less Variables
How to use: Custom Theme.
| Name |
Default Value |
Description |
| @switch-cell-padding-top |
@cell-vertical-padding - 1px |
- |
| @switch-cell-padding-bottom |
@cell-vertical-padding - 1px |
- |
| @switch-cell-large-padding-top |
@cell-large-vertical-padding - 1px |
- |
| @switch-cell-large-padding-bottom |
@cell-large-vertical-padding - 1px |
- |