Element-ui date and time control problem

  • it is OK to assign an initial value to the control, but there is no way to change the value through the control without reporting an error. It is very strange. I have been working on it for two days.
<el-date-picker
    v-model="dataForm.time = new Date("2018-08-08")"
    type="datetime"
    placeholder="">
</el-date-picker>
  • as shown in the figure: initialization assignment is possible:

clipboard.png

  • ::

clipboard.png

  • date cannot be selected, and the control will not disappear after clicking OK. Under normal circumstances, you should be able to select a date and time, and then click OK and the date and time should appear in the input box
.

Yes, silly boy.

your v-model binds an expression and executes dataForm.time = new Date ('2018-08-08') every time it is updated.

generally speaking, initial values are assigned directly to data

data(){
    return {
        dataForm:{
            time:new Date(),
        }
    }
}
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-1b2c3ee-2bb06.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-1b2c3ee-2bb06.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?