fetch(add): 账户管理
This commit is contained in:
@@ -21,46 +21,46 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue'
|
||||
import { OPERATOR_OPTIONS } from '@/config/constants'
|
||||
import type { Operator } from '@/types/api'
|
||||
import { computed } from 'vue'
|
||||
import { OPERATOR_OPTIONS } from '@/config/constants'
|
||||
import type { Operator } from '@/types/api'
|
||||
|
||||
interface Props {
|
||||
modelValue?: Operator | Operator[]
|
||||
placeholder?: string
|
||||
clearable?: boolean
|
||||
disabled?: boolean
|
||||
multiple?: boolean
|
||||
filterable?: boolean
|
||||
size?: 'large' | 'default' | 'small'
|
||||
}
|
||||
|
||||
interface Emits {
|
||||
(e: 'update:modelValue', value: Operator | Operator[] | undefined): void
|
||||
(e: 'change', value: Operator | Operator[] | undefined): void
|
||||
}
|
||||
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
placeholder: '请选择运营商',
|
||||
clearable: true,
|
||||
disabled: false,
|
||||
multiple: false,
|
||||
filterable: true,
|
||||
size: 'default'
|
||||
})
|
||||
|
||||
const emit = defineEmits<Emits>()
|
||||
|
||||
const operatorOptions = OPERATOR_OPTIONS
|
||||
|
||||
const selectedValue = computed({
|
||||
get: () => props.modelValue,
|
||||
set: (val) => {
|
||||
emit('update:modelValue', val)
|
||||
interface Props {
|
||||
modelValue?: Operator | Operator[]
|
||||
placeholder?: string
|
||||
clearable?: boolean
|
||||
disabled?: boolean
|
||||
multiple?: boolean
|
||||
filterable?: boolean
|
||||
size?: 'large' | 'default' | 'small'
|
||||
}
|
||||
})
|
||||
|
||||
const handleChange = (value: Operator | Operator[] | undefined) => {
|
||||
emit('change', value)
|
||||
}
|
||||
interface Emits {
|
||||
(e: 'update:modelValue', value: Operator | Operator[] | undefined): void
|
||||
(e: 'change', value: Operator | Operator[] | undefined): void
|
||||
}
|
||||
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
placeholder: '请选择运营商',
|
||||
clearable: true,
|
||||
disabled: false,
|
||||
multiple: false,
|
||||
filterable: true,
|
||||
size: 'default'
|
||||
})
|
||||
|
||||
const emit = defineEmits<Emits>()
|
||||
|
||||
const operatorOptions = OPERATOR_OPTIONS
|
||||
|
||||
const selectedValue = computed({
|
||||
get: () => props.modelValue,
|
||||
set: (val) => {
|
||||
emit('update:modelValue', val)
|
||||
}
|
||||
})
|
||||
|
||||
const handleChange = (value: Operator | Operator[] | undefined) => {
|
||||
emit('change', value)
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user