gpt4 book ai didi

javascript - 无法禁用vue js Material 日期选择器中的日期

转载 作者:行者123 更新时间:2023-11-28 03:51:23 25 4
gpt4 key购买 nike

HTML 代码是

 <datepicker :date="child" :option="option" v-model="child.dob" @change="updatechildDOB(child)" :disabled="disabled"></datepicker>

选项有:

option: {    type: 'day',    week: ['Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa', 'Su'],    month: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],    format: 'YYYY-MM-DD',    placeholder: 'Date of birth',    color: {        header: '#2b98a7',        headerText: '#fff'    },    buttons: {        ok: 'Ok',        cancel: 'Cancel'    },    overlayOpacity: 0.5, // 0.5 as default        dismissible: true // as true as default    },    disabled: {        from: new Date()    },

有什么帮助吗?

最佳答案

您需要做的是:

disabled: {
to: new Date(2016, 0, 5), // Disable all dates up to specific date
from: new Date(2016, 0, 26), // Disable all dates after specific date
}

查看文档 https://github.com/charliekassel/vuejs-datepicker

关于javascript - 无法禁用vue js Material 日期选择器中的日期,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47974392/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com