最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
vxe-select下拉框:人员选择功能实现方案
时间:2026-05-27 15:55:01 编辑:袖梨 来源:一聚教程网
在Web开发中,人员选择器是常见的交互组件。本文将详细讲解如何通过vxe-select组件实现一个功能丰富的人员选择器,包含头像展示、状态标签、多选和搜索等实用特性。
效果
多选、清空、筛选
自定义选项模板(头像 + 姓名 + 状态标签)
下拉框尺寸定制
状态映射(离职/试用期)
代码
{{ option.label }}
{{
getUserStatus(option.status)
}}
import { reactive, ref } from 'vue'const val1 = ref()const selectOptions = reactive({
multiple: true,
filterable: true,
clearable: true,
showCheckbox: true,
showCloseButton: true,
placeholder: '人员选择',
optionConfig: {
height: 40
},
popupConfig: {
width: 300,
height: 420
},
options: [
{
label: '张三',
value: '1',
status: 'dimission',
url: 'https://vxeui.com/resource/avatarImg/avatar1.jpeg'
},
{
label: '小明',
value: '2',
status: '',
url: 'https://vxeui.com/resource/avatarImg/avatar2.jpeg'
},
{
label: '老刘',
value: '3',
status: 'trial',
url: 'https://vxeui.com/resource/avatarImg/avatar3.jpeg'
},
{
label: '李四',
value: '4',
status: '',
url: 'https://vxeui.com/resource/avatarImg/avatar4.jpeg'
},
{
label: '老六',
value: '5',
status: 'trial',
url: 'https://vxeui.com/resource/avatarImg/avatar
相关文章
- 深海迷航2:异星水域-全生物床获取指南与心得分享 05-27
- Debian系统中PHP的兼容性挑战 05-27
- Ubuntu系统如何配置Compton窗口透明度 05-27
- Oracle迁移至PostgreSQL过程中SQL查询结果差异分析与处理方案 05-27
- 百度搜有红包如何参与-百度搜有红包活动入口在哪 05-27
- camtasia2018视频素材如何调整画面尺寸 05-27