avue 时间选择器限制时间范围

基本单位由type属性指定。快捷选项需配置pickerOptions对象中的shortcuts,禁用日期通过 disabledDate 设置,传入函数

<avue-form v-model="form" :option="option"></avue-form>

<script>
export default {
    data() {
      return {
        form:{},
        option:{
          column: [{
              label: "禁止日期",
              prop: "date",
              type: "date",  
              pickerOptions: {
              disabledDate(time) {
                return time.getTime() < Date.now();
              },
            }
          }]
        },
      };
    }
}
</script>

运行效果:

猜你喜欢

转载自blog.csdn.net/u012320487/article/details/123640262