rayyy-vue-table-components 1.3.17 → 1.3.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,62 +0,0 @@
1
- <template>
2
- <el-select
3
- v-bind="attrs"
4
- :model-value="modelValue"
5
- :class="props.class"
6
- :placeholder="props.placeholder"
7
- :clearable="props.clearable"
8
- :collapse-tags="props.collapseTags"
9
- :collapse-tags-tooltip="props.collapseTagsTooltip"
10
- :multiple="props.multiple"
11
- :disabled="props.disabled"
12
- :reserve-keyword="false"
13
- filterable
14
- @update:model-value="updateValue"
15
- >
16
- <el-option v-for="it in options" :key="it.label" :label="it.label" :value="it.value" />
17
- </el-select>
18
- </template>
19
-
20
- <script lang="ts" setup>
21
- import { useAttrs } from 'vue'
22
- import type { ElOptions } from '@/types/OptionDto.ts'
23
-
24
- export type Selection = string | string[]
25
-
26
- const props = withDefaults(
27
- defineProps<{
28
- modelValue?: Selection
29
- options?: ElOptions[]
30
- placeholder?: string
31
- clearable?: boolean
32
- collapseTags?: boolean
33
- collapseTagsTooltip?: boolean
34
- multiple?: boolean
35
- disabled?: boolean
36
- class?: string
37
- }>(),
38
- {
39
- modelValue: () => '',
40
- options: () => [{ value: '', label: '' }],
41
- placeholder: '請選擇',
42
- class: 'w-full',
43
- },
44
- )
45
-
46
- // 獲取所有非 props 屬性
47
- const attrs = useAttrs()
48
-
49
- const emits = defineEmits<{
50
- (e: 'update:modelValue', data?: Selection): void
51
- }>()
52
-
53
- function updateValue(val: Selection) {
54
- let value: Selection | undefined = val
55
-
56
- if (typeof value === 'string' && !value) {
57
- value = undefined
58
- }
59
-
60
- emits('update:modelValue', value)
61
- }
62
- </script>