qcp QCP pad
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

43 lines
1.2 KiB

<template>
<view>
<uni-easyinput :value="value" type="text" placeholder="请输入" @input="$emit('on-change', $event)" v-if="config.type === 'input'" />
<uni-datetime-picker type="datetime" :value="value" :modelValue="value" @change="$emit('on-change', $event)"
v-else-if="config.type === 'datetime'" />
<uni-data-checkbox :value="value" :localdata="config.range" @change="$emit('on-change', $event.detail.value)"
v-else-if="config.type === 'radio'" />
<uni-data-select :value="value" :modelValue="value" :localdata="config.range" @change="$emit('on-change', $event)"
v-else-if="config.type === 'select'"></uni-data-select>
</view>
</template>
<script lang="ts" setup>
import { CODE_DICT } from '@/config/code'
import { computed } from 'vue'
interface IConfig {
text: string
type: string
default: string
range?: { value: string, text: string }[]
showType?: {
type: string
code: string
value: string
}
}
interface IProps {
code: string
value: string
}
const props = defineProps<IProps>()
defineEmits(['on-change'])
const config = computed<IConfig>(() => CODE_DICT[props.code])
</script>
<style lang="scss" scoped>
</style>