chatpromptsubmit
xph0000xUso
El componente ChatPromptSubmit se utiliza dentro del componente ChatPrompt para enviar el mensaje.
Extiende el componente Button, por lo que puede pasar cualquier propiedad como color, variant, size, etc.
<template>
<UChatPrompt>
<UChatPromptSubmit />
</UChatPrompt>
</template>
footer del componente ChatPrompt.Listado
Cuando su estado es ready, utilice los accesorios color, variant y icon para personalizar el botón.
- xxx
color="primary"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx - xx
variant="solid"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
<template>
<UChatPromptSubmit color="primary" variant="solid" icon="i-lucide-arrow-up" />
</template>Enviado
Cuando su estado es submitted, utilice los accesorios submitted-color, submitted-variant y submitted-icon para personalizar el botón.
- xx
submittedColor="neutral"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx - xx
submittedVariant="subtle"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
stop se emite cuando el usuario hace clic en el botón.<template>
<UChatPromptSubmit
submitted-color="neutral"
submitted-variant="subtle"
submitted-icon="i-lucide-square"
status="submitted"
/>
</template>Streaming en vivo
Cuando su estado es streaming, utilice los accesorios streaming-color, streaming-variant y streaming-icon para personalizar el botón.
- x
streamingColor="neutral"x{lang="ts-type"} - x
streamingVariant="subtle"x{lang="ts-type"} - x
streamingIcon="i-lucide-square"x{lang="ts-type"}
stop se emite cuando el usuario hace clic en el botón.<template>
<UChatPromptSubmit
streaming-color="neutral"
streaming-variant="subtle"
streaming-icon="i-lucide-square"
status="streaming"
/>
</template>Error en
Cuando su estado es error, utilice los accesorios error-color, error-variant y error-icon para personalizar el botón.
- x
errorColor="error"x{lang="ts-type"} (Edición española) - x
errorVariant="soft"x{lang="ts-type"} (Edición española) - x
errorIcon="i-lucide-rotate-ccw"xx{lang="ts-type"}
reload se emite cuando el usuario hace clic en el botón.<template>
<UChatPromptSubmit
error-color="error"
error-variant="soft"
error-icon="i-lucide-rotate-ccw"
status="error"
/>
</template>Ejemplos
API (Versión)
Props (accesorios)
| Prop | Default | Type |
|---|---|---|
as | 'button' | anyThe element or component this component should render as when not a link. |
status | 'ready' | "error" | "ready" | "submitted" | "streaming" |
icon | appConfig.ui.icons.arrowUp | anyThe icon displayed in the button when the status is |
color | 'primary' | "error" | "primary" | "secondary" | "success" | "info" | "warning" | "neutral"The color of the button when the status is |
variant | 'solid' | "link" | "outline" | "soft" | "subtle" | "ghost" | "solid"The variant of the button when the status is |
streamingIcon | appConfig.ui.icons.stop | anyThe icon displayed in the button when the status is |
streamingColor | 'neutral' | "error" | "primary" | "secondary" | "success" | "info" | "warning" | "neutral"The color of the button when the status is |
streamingVariant | 'subtle' | "link" | "outline" | "soft" | "subtle" | "ghost" | "solid"The variant of the button when the status is |
submittedIcon | appConfig.ui.icons.stop | anyThe icon displayed in the button when the status is |
submittedColor | 'neutral' | "error" | "primary" | "secondary" | "success" | "info" | "warning" | "neutral"The color of the button when the status is |
submittedVariant | 'subtle' | "link" | "outline" | "soft" | "subtle" | "ghost" | "solid"The variant of the button when the status is |
errorIcon | appConfig.ui.icons.reload | anyThe icon displayed in the button when the status is |
errorColor | 'error' | "error" | "primary" | "secondary" | "success" | "info" | "warning" | "neutral"The color of the button when the status is |
errorVariant | 'soft' | "link" | "outline" | "soft" | "subtle" | "ghost" | "solid"The variant of the button when the status is |
autofocus | false | true | "true" | "false" | |
avatar | AvatarPropsDisplay an avatar on the left side. | |
loading | boolean When | |
loadingIcon | appConfig.ui.icons.loading | anyThe icon when the |
disabled | boolean | |
name | string | |
label | string | |
size | 'md' | "xs" | "sm" | "md" | "lg" | "xl" |
leading | boolean When | |
leadingIcon | anyDisplay an icon on the left side. | |
trailing | boolean When | |
trailingIcon | anyDisplay an icon on the right side. | |
type | 'button' | "reset" | "submit" | "button"The type of the button when not a link. |
activeColor | "error" | "primary" | "secondary" | "success" | "info" | "warning" | "neutral" | |
activeVariant | "link" | "outline" | "soft" | "subtle" | "ghost" | "solid" | |
square | boolean Render the button with equal padding on all sides. | |
block | boolean Render the button full width. | |
loadingAuto | boolean Set loading state automatically based on the | |
ui | { base?: SlotClass; } & { base?: SlotClass; label?: SlotClass; leadingIcon?: SlotClass; leadingAvatar?: SlotClass; leadingAvatarSize?: SlotClass; trailingIcon?: SlotClass; } |
Slots (Edición española)
| Slot | Type |
|---|---|
leading | { ui: object; } |
default | { ui: object; } |
trailing | { ui: object; } |
Emisiones
| Event | Type |
|---|---|
stop | [event: MouseEvent] |
reload | [event: MouseEvent] |
Theme (en inglés)
export default defineAppConfig({
ui: {
chatPromptSubmit: {
slots: {
base: ''
}
}
}
})import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import ui from '@nuxt/ui/vite'
export default defineConfig({
plugins: [
vue(),
ui({
ui: {
chatPromptSubmit: {
slots: {
base: ''
}
}
}
})
]
})