vue3 + ts实现uniapp下拉多选框
直接上代码
components组件内声明multipleSelect.vue组件 这个放代码怪怪的,各位自己拉下来看吧 组件内使用实例如下:
详细props参数配置可自行参考代码
对返回的changeMonIndex函数中的item进行操作即可 `<multipleSelect :value="monIndex" placeholder="请选择项目" :options="monIndexList" @change="changeMonIndex">
// 监控指标
let monIndex = reactive([0, 1]);
const changeMonIndex = (item: any, value: any) => { monIndex = value; };
const monIndexList = [ { value: 0, text: "测试1" }, { value: 1, text: "测试2" }, { value: 2, text: "测试3" }, { value: 3, text: "测试4" }, { value: 4, text: "测试5" }, ];`