Prompt Input
Vue 已实现 · 还原验收 0/1 · 上游演示 · 固定版本源码
预览
用法
vue
<script setup lang="ts">
import { PromptInput } from 'beui-vue'
import { ref } from 'vue'
const report = ref('')
const models = [{ value: 'fast', label: 'Fast' }, { value: 'reasoning', label: 'Reasoning' }]
const actions = [{ value: 'context', label: 'Attach context', description: 'Include notes in the next prompt' }]
</script>
<template>
<div class="be-agent-demo"><PromptInput :models="models" :actions="actions" @submit="(value, model) => report = `${model} · ${value}`" @action="report = 'Context attached'" /><output role="status">{{ report }}</output></div>
</template>API
v-model 或 defaultValue 控制文本。models、v-model:model 设置模型,actions 配合 @action 扩展工具。Enter 提交、Shift+Enter 换行。@submit 返回文本与模型,loading 配合 @stop 中断生成。