Ações
VSwipeRow
Linha com ações reveladas por **swipe horizontal** (arraste o conteúdo para a esquerda; as ações ficam à direita, então arrastar para a direita é bloqueado). Teclado: **Seta esquerda** revela as ações, **Seta direita**/**Esc** fecha; clicar fora também fecha. Emite `action` com a ação clicada.
<script setup lang="ts">
import { VSwipeRow } from 'vueui-nova-kit'
</script>Uso
<VSwipeRow :actions="[{ key: 'delete', label: 'Excluir', intent: 'destructive' }]" @action="onAction">
Mensagem da caixa de entrada
</VSwipeRow>Playground
Os controles abaixo são gerados a partir das props declaradas em VSwipeRow.types.ts; o código acompanha cada mudança.
Exemplos
Variantes, tamanhos e estados, extraídos das stories da biblioteca.
Default
Variação Padrão. Estado padrão do componente; use a aba Controls para experimentar as props ao vivo.
Ver código
<script setup lang="ts">
import { VSwipeRow } from 'vueui-nova-kit'
const args = {
actions: [
{
key: 'archive',
label: 'Arquivar'
},
{
key: 'delete',
label: 'Excluir',
intent: 'destructive'
}
],
disabled: false,
motion: 'expressive'
}
</script>
<template>
<VSwipeRow v-bind="args">
<div style="padding:16px;background:var(--v-color-surface);color:var(--v-color-text);">Mensagem da caixa de entrada</div>
</VSwipeRow>
</template>Disabled
Variação Desabilitado. Props: disabled=true.
Ver código
<script setup lang="ts">
import { VSwipeRow } from 'vueui-nova-kit'
const args = {
actions: [
{
key: 'archive',
label: 'Arquivar'
},
{
key: 'delete',
label: 'Excluir',
intent: 'destructive'
}
],
disabled: true,
motion: 'expressive'
}
</script>
<template>
<VSwipeRow v-bind="args">
<div style="padding:16px;background:var(--v-color-surface);color:var(--v-color-text);">Mensagem da caixa de entrada</div>
</VSwipeRow>
</template>Single Action
Variação Single Action.
Ver código
<script setup lang="ts">
import { VSwipeRow } from 'vueui-nova-kit'
const args = {
actions: [
{
key: 'delete',
label: 'Excluir',
intent: 'destructive'
}
],
disabled: false,
motion: 'expressive'
}
</script>
<template>
<VSwipeRow v-bind="args">
<div style="padding:16px;background:var(--v-color-surface);color:var(--v-color-text);">Mensagem da caixa de entrada</div>
</VSwipeRow>
</template>No Motion
Variação Sem movimento. Props: motion="none".
Ver código
<script setup lang="ts">
import { VSwipeRow } from 'vueui-nova-kit'
const args = {
actions: [
{
key: 'archive',
label: 'Arquivar'
},
{
key: 'delete',
label: 'Excluir',
intent: 'destructive'
}
],
disabled: false,
motion: 'none'
}
</script>
<template>
<VSwipeRow v-bind="args">
<div style="padding:16px;background:var(--v-color-surface);color:var(--v-color-text);">Mensagem da caixa de entrada</div>
</VSwipeRow>
</template>Props
| Prop | Tipo | Default | Descrição |
|---|---|---|---|
actions | VSwipeRowAction[] | [] | — |
disabled | boolean | false | — |
motion | VMotionLevel | V_MOTION_DEFAULT ("expressive") | — |
Events
| Evento | Payload | Descrição |
|---|---|---|
@action | payload: VSwipeRowAction | — |
Slots
| Slot | Props do slot |
|---|---|
#default | — |
Fonte: src/components/navigation/VSwipeRow/VSwipeRow.vue · tipos: src/components/navigation/VSwipeRow/VSwipeRow.types.ts