The form is initially invisible, opens when you click on the button. There are fields in the form, one of which is input to which you need to insert a date (each time this form is opened, the date should be current, that is, as soon as the form is opened, but it turns out that the date is formed when the page loads and no longer changes) looks like that:

 <el-form :model="Phonebook_user" label-width="140px"> <el-form-item label="Users date"> <el-input id="data_field" v-model="time" disabled/> </el-form-item> <el-form-item label="Users numer"> <el-input v-model="Phonebook_user.numer"/> </el-form-item> <el-form-item label="Users name"> <el-input v-model="Phonebook_user.name"/> </el-form-item> <el-form-item label="Users info"> <el-input v-model="Phonebook_user.info"/> </el-form-item></el-form> 

For the date I use time: this.getTime() and the function itself:

 getTime: function() { var dat = new Date() this.time = dat.toUTCString() return this.time } 

And how then to add this date to the class Phonebook_user?

    1 answer 1

    I understand that the form in the el-dialogue or invisible until something happens? Try to declare a variable in the date and set the value in the computer (or in the night) at the moment when the condition of opening the form is fulfilled.

    • @Andrey Ivasko, corrected the description to make it clearer - Alex