Select 选择器

说明

用于选择数据

代码示例

>{}
<template>
  <div>
    <Select v-model="the.type" @onEvent="onSizeEvent">
      <option v-for="(item, index) in the.typeList" :key="index" :value="index">
        {{ item }}
      </option>
    </Select>
  </div>
</template>

<script>
export default {
  setup(props, context) {
    // 使用外挂方式引入,具体查看demo
    const $plus = window.$plus;
    const reactive = $plus.vue.reactive;

    const the = reactive({
      type: 2,
      typeList: ['初始', '正常', '已审', '撤审', '删除'],
    });

    const onSizeEvent = (res) => {
      switch (res.cmd) {
        case 'change':
          break;
      }
    };

    return { the, onSizeEvent };
  },
};
</script>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33

API

Select props

属性说明类型默认值
v-model双向绑定数据String-

Select events

事件名说明返回值
onEvent点击触发回调事件json

Events cmd change

参数名说明类型
value选中值的索引Number
event选中事件的回调Boolean

Option props

属性说明类型默认值
value选择值,必填String or Number-

Last Updated: