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.
|
|
|
|
<!--
|
|
|
|
|
@ 作者: 秦东
|
|
|
|
|
@ 时间: 2024-11-14 13:08:53
|
|
|
|
|
@ 备注: 日期选择器
|
|
|
|
|
-->
|
|
|
|
|
<script lang='ts' setup>
|
|
|
|
|
const props = withDefaults(
|
|
|
|
|
defineProps<{
|
|
|
|
|
modelValue?: string
|
|
|
|
|
disabled?: boolean
|
|
|
|
|
data?:any
|
|
|
|
|
}>(),
|
|
|
|
|
{}
|
|
|
|
|
)
|
|
|
|
|
const emits = defineEmits<{
|
|
|
|
|
(e: 'update:modelValue', value: string): void
|
|
|
|
|
}>()
|
|
|
|
|
const value = computed({
|
|
|
|
|
get: () => {
|
|
|
|
|
return props.modelValue
|
|
|
|
|
},
|
|
|
|
|
set: (newVal: any) => {
|
|
|
|
|
emits('update:modelValue', newVal)
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
//阻止唤起键盘
|
|
|
|
|
const handleClick = (event) => {
|
|
|
|
|
// 阻止输入框默认行为
|
|
|
|
|
event.target.readOnly = true;
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|
<template>
|
|
|
|
|
<el-date-picker
|
|
|
|
|
align="left"
|
|
|
|
|
v-model="value"
|
|
|
|
|
:type="props.data.control.type"
|
|
|
|
|
range-separator="-"
|
|
|
|
|
start-placeholder="开始日期"
|
|
|
|
|
end-placeholder="结束日期"
|
|
|
|
|
:teleported="true"
|
|
|
|
|
:placeholder="props.data.control.placeholder"
|
|
|
|
|
:value-format="props.data.valueFormat"
|
|
|
|
|
:format="props.data.control.format"
|
|
|
|
|
@click="handleClick"
|
|
|
|
|
@focus="handleClick"
|
|
|
|
|
/>
|
|
|
|
|
</template>
|
|
|
|
|
<style lang='scss' scoped>
|
|
|
|
|
|
|
|
|
|
</style>
|