After assigning a value to the element date selection box, it doesn't work?

element-ui + vue for the project. I wrote a date selection box in the diolag of element, and then I need to echo the acquired time data to the time box when the modal box is displayed. The
code is as follows:

                     <el-date-picker
                            style="float: left;"
                            v-model="editDetails.timeArr"
                            type="daterange"
                            size="small"
                            value-format="yyyy-MM-dd"
                            range-separator=""
                            start-placeholder=""
                            end-placeholder="">
                    </el-date-picker>
                    
                    //js
                    data(){
                        return {
                            timeArr:""
                        }
                    }
                    //js
                    this.outerVisibleStop = true;
                    this.editDetails = command.details
                    this.editDetails.timeArr = [command.details.usage_tmp.start_time,command.details.usage_tmp.end_time]
                    
                    

question:
the data will indeed be echoed into the time box, but when I click on the time box to change the date, the value in the time mania will not change.

as shown in figure

clipboard.png

clipboard.png

after I choose, the date will still be 08-21 to 08-24, and I find that I define the initial value in data, and the value in the time box does not change accordingly

Apr.26,2021

Vue instance data does not have this value v-model value


how is your v-model bound? Just the code you give, I can't understand what you're going to do

by the way, which hospital is your platform for? name it so that we can avoid

next time.

Link description

No, use it normally


image.png when assigning this value, use this.$set (this.editDetails,'timeArr',data); so you can change the date


solve the problem, but have not studied the specific reason, wait for the project to go online and then go back and take a closer look, because I added an open event to the outer layer of the nested dialog, resulting in the value of the inner time box cannot be bound, and it would be nice to get rid of the open event.


I encountered it, too. But it should be too deep nested. I can't find a solution. Now in data, put the field you want to assign on the outside of the object.

Menu