feat: setting页面
This commit is contained in:
@@ -29,6 +29,7 @@ const props = defineProps<{
|
||||
modelValue: string | number | boolean | Array<string | number | boolean> | null
|
||||
options: Option[] // 按钮选项数组
|
||||
multiple?: boolean // 是否支持多选,默认为 false
|
||||
max?: number // 多选时最多可选数量,不传则不限制
|
||||
}>()
|
||||
|
||||
const emit = defineEmits<{
|
||||
@@ -54,6 +55,9 @@ const selectOption = (value: any) => {
|
||||
if (index >= 0) {
|
||||
current.splice(index, 1)
|
||||
} else {
|
||||
if (typeof props.max === 'number' && props.max > 0 && current.length >= props.max) {
|
||||
current.shift()
|
||||
}
|
||||
current.push(value)
|
||||
}
|
||||
emit('update:modelValue', current)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user