schangxiang@126.com
2025-05-21 a3a2b238a2626ef8744e7a135f9ca2e2fbb5184c
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
34
35
36
37
import { defineComponent, ref } from 'vue'
import IconButton from '@/components/IconButton/IconButton'
import { CaretBottom } from '@element-plus/icons-vue'
import Tag from '../Tag/Tag'
import styles from './SelectInput.module.scss'
import { useVModel } from '@vueuse/core'
import { _t } from '@/libs/Language/Language'
export default defineComponent({
  name: 'SelectInput',
  props: {
    modelValue: {
      type: Array,
      default: () => [],
    },
  },
  emits: ['click', 'onUpdate:modelValue'],
  setup(props, { attrs, slots, emit }) {
    const tagValue = useVModel(props)
 
    const onClick = () => {
      emit('click')
    }
 
    return () => {
      return (
        <div class={styles.wrap}>
          <div class={styles.tagWrap}>
            <Tag showClose={true} v-model:data={tagValue.value} />
          </div>
          <el-button class={styles.selectBtn} onClick={onClick}>
            {_t('选择')}
          </el-button>
        </div>
      )
    }
  },
})