更新记录
1.0.0(2026-08-12) 下载此版本
首次发布:支持底部选择弹窗与锚点式 popover、图标、描述、选中态及关闭/选择事件。
平台兼容性
AI 聊天选择弹窗
组件名:
ai-chat-select-popup
零依赖的 uni-app 选择组件,支持底部弹窗(sheet)与锚点菜单(popover)两种展示方式。
安装
插件市场导入后保留 uni_modules/ai-chat-select-popup;已开启 easycom 时可直接使用。也可手动导入:
import AiChatSelectPopup from '@/uni_modules/ai-chat-select-popup/components/ai-chat-select-popup/ai-chat-select-popup.vue'
npm 安装:
npm install uni-ai-chat-select-popup
import AiChatSelectPopup from 'uni-ai-chat-select-popup'
底部选择弹窗
<ai-chat-select-popup
:show="visible"
title="选择题型"
:options="options"
:value="selectedValue"
@close="visible = false"
@select="handleSelect"
/>
export default {
data() {
return {
visible: false,
selectedValue: 'single',
options: [
{ label: '单选题', value: 'single', description: '只有一个正确答案' },
{ label: '多选题', value: 'multiple', description: '可选择多个答案' }
]
}
},
methods: {
handleSelect(option) {
this.selectedValue = option.value
this.visible = false
}
}
}
锚点菜单
将组件放在目标元素的相对定位容器内,传入 mode="popover" 和定位样式:
<ai-chat-select-popup
:show="visible"
mode="popover"
:custom-style="{ right: '0', bottom: '80rpx' }"
:options="options"
:value="selectedValue"
@close="visible = false"
@select="handleSelect"
/>
属性
| 属性 | 类型 | 默认值 | 说明 |
|---|---|---|---|
show |
Boolean | false |
是否显示 |
title |
String | '' |
sheet 模式标题 |
options |
Array | [] |
选项:{ label, value, description?, iconSrc? } |
value |
String / Number / Boolean | '' |
当前选中值 |
mode |
String | sheet |
sheet 或 popover |
customStyle |
Object | {} |
popover 的定位及自定义样式 |
maskClosable |
Boolean | true |
sheet 点击遮罩是否关闭 |
closeOnSelect |
Boolean | false |
选择后是否自动关闭 |
事件
| 事件 | 参数 | 说明 |
|---|---|---|
select |
当前 option | 点击选项 |
close |
关闭原因 | mask、close-button 或 select |
平台与发布
支持 Vue 2 的微信小程序、App-Vue 和 H5,无第三方依赖;不支持 nvue 与 Vue 3。
发布 npm:
cd plugins/AiChatSelectPopup/uni_modules/ai-chat-select-popup
npm login
npm publish

收藏人数:
下载插件并导入HBuilderX
赞赏(0)
下载 4
赞赏 0
下载 12500751
赞赏 1940
赞赏
京公网安备:11010802035340号