fix presentMax
This commit is contained in:
parent
58c3616a30
commit
bc4cec48e4
|
@ -5,7 +5,7 @@
|
||||||
v-model="inner"
|
v-model="inner"
|
||||||
:name="name"
|
:name="name"
|
||||||
:min="min"
|
:min="min"
|
||||||
:max="max"
|
:max="presentMax"
|
||||||
:type="type"
|
:type="type"
|
||||||
placeholder=""
|
placeholder=""
|
||||||
class="bg-white group-[.info]:bg-blue-200 rounded-lg focus:outline-none text-gray-600 text-left w-full py-1 @sm:py-2 @sm:group-[.info]:py-1 px-2 @sm:px-3 @sm:group-[.info]:px-2 text-sm @sm:text-base @sm:group-[.info]:text-sm"
|
class="bg-white group-[.info]:bg-blue-200 rounded-lg focus:outline-none text-gray-600 text-left w-full py-1 @sm:py-2 @sm:group-[.info]:py-1 px-2 @sm:px-3 @sm:group-[.info]:px-2 text-sm @sm:text-base @sm:group-[.info]:text-sm"
|
||||||
|
@ -44,8 +44,12 @@ const props = defineProps({
|
||||||
type: String,
|
type: String,
|
||||||
},
|
},
|
||||||
min: {
|
min: {
|
||||||
type: String,
|
type: Number,
|
||||||
default: () => '',
|
default: () => undefined,
|
||||||
|
},
|
||||||
|
max: {
|
||||||
|
type: Number,
|
||||||
|
default: () => undefined,
|
||||||
},
|
},
|
||||||
label: {
|
label: {
|
||||||
required: true,
|
required: true,
|
||||||
|
@ -68,8 +72,16 @@ const props = defineProps({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const max = computed(() => {
|
const presentMax = computed(() => {
|
||||||
return props.maxToday ? dayjs().format('YYYY-MM-DD') : null;
|
if (props.type === 'date' && props.maxToday) {
|
||||||
|
return dayjs().format('YYYY-MM-DD');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (props.type === 'number') {
|
||||||
|
return props.max;
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
});
|
});
|
||||||
|
|
||||||
const inner = computed({
|
const inner = computed({
|
||||||
|
|
Loading…
Reference in New Issue