英文:
How can I disable selecting a particular date in a VCalendar Date Picker?
问题
如何使日期选择器范围内不可能选择相同的日期?
如何移除选择分钟的选项?
我尝试使用 :minute-increment="60"
移除选择分钟的能力。
英文:
How can I make it impossible to select the same date for a Date Picker range ?
And how to remove the option to select minutes?
I tried to remove the ability to select minutes using :minute-increment="60"
答案1
得分: 0
To disable minute selection, you can add a rule to fix them to 0.
要禁用分钟选择,您可以添加一个规则将它们固定为0。
英文:
To disable minute selection, you can add a rule to fix them to 0. See the documentation.
<template>
<VDatePicker v-model="date" mode="dateTime" :rules="rules" />
</template>
<script setup>
import { ref } from 'vue';
const date = ref(new Date(2000, 0, 15));
const rules = {
minutes: 0,
seconds: 0,
milliseconds: 0,
};
</script>
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论