Check of date range selected by element-ui

the backend asked to make the selection of this date range a required entry in the form, but did not find the corresponding check in element-ui. I tried to fill in required and message, in rules, but when I did not select a time, the word "Please choose a time" did not appear on the page. Can anyone help me answer it? thank you

May.25,2021

you can customize a test

data(){
    var validDate = (rule,value,callback) => {
        if(!value[0] || !value[1]){
            callback(new Error(""))
        }else{
            callback()
        }
    }
    return {
        rules: {
            daterange: [{
                validator: validDate,
                trigger: 'blur'
            }]
        }
    }
}

you can also do more complex verification, such as whether daterange is an array type, and validation of date intervals


http://element-cn.eleme.io/-sharp/.
Form component provides the function of form validation by passing in the agreed validation rules through the rules attribute and setting the prop property of Form-Item to the field name to be verified. Take a closer look at the document

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b360d9-2b75d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b360d9-2b75d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?