更新记录

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 sheetpopover
customStyle Object {} popover 的定位及自定义样式
maskClosable Boolean true sheet 点击遮罩是否关闭
closeOnSelect Boolean false 选择后是否自动关闭

事件

事件 参数 说明
select 当前 option 点击选项
close 关闭原因 maskclose-buttonselect

平台与发布

支持 Vue 2 的微信小程序、App-Vue 和 H5,无第三方依赖;不支持 nvue 与 Vue 3。

发布 npm:

cd plugins/AiChatSelectPopup/uni_modules/ai-chat-select-popup
npm login
npm publish

隐私、权限声明

1. 本插件需要申请的系统权限列表:

2. 本插件采集的数据、发送的服务器地址、以及数据用途说明:

插件不采集任何数据

3. 本插件是否包含广告,如包含需详细说明广告表达方式、展示频率:

许可协议

MIT License

Copyright (c) 2026

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

暂无用户评论。