展示可点击的快捷提问列表。
<script setup lang="ts">
import { ref } from 'vue'
import { DanSuggestion } from '@dandan-ui/ui'
const selected = ref('')
</script>
<template>
<div style="display: grid; gap: 12px">
<DanSuggestion
:items="['写一个按钮', '解释 Form 校验', '给 Chat 加停止']"
@select="selected = $event"
/>
<div style="color: var(--dan-color-text-secondary); font-size: 13px">
当前选择:{{ selected || '无' }}
</div>
</div>
</template>| 属性 | 说明 | 类型 | 默认值 | 必填 |
|---|---|---|---|---|
| items | 建议文案列表 | string[] | [] | 否 |
| 事件名 | 说明 | 回调参数 |
|---|---|---|
| select | 点击某条建议 | (item: string) => void |
| 插槽名 | 说明 |
|---|---|
| default | 在内置 items 后追加自定义内容 |