這是正常賦值方式:
this.form.startTime = item.warnValue.split('-')[0] this.form.endTime = item.warnValue.split('-')[1]
賦值已經成功,但是修改值的時候組件顯示的值並沒有修改.
修正后代碼:
this.$set(this.form, 'startTime', item.warnValue.split('-')[0]) this.$set(this.form, 'endTime', item.warnValue.split('-')[1])
賦值成功並且可以修改.