欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

vue?el-date-picker?日期回顯后無(wú)法改變問(wèn)題解決

 更新時(shí)間:2023年04月11日 14:24:11   作者:阿wei程序媛  
這篇文章主要介紹了vue?el-date-picker?日期回顯后無(wú)法改變問(wèn)題解決,本文給大家介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下

場(chǎng)景描述:點(diǎn)擊修改,數(shù)據(jù)回顯渲染,后端返回我的是startTime和endTime,我需要將其處理,放到一個(gè)數(shù)組里面,并將其賦值

后端返回?cái)?shù)據(jù)

   <el-form-item label="適用時(shí)間" prop="time1">
          <el-date-picker
            v-model="form.time1"
            type="datetimerange"
            style="width: 380px"
            :default-time="['00:00:00', '23:59:59']"
            range-separator="至"
            value-format="yyyy-MM-dd HH:mm:ss"
            :picker-options="expireTimeOPtion"
            @change="beginDateChange"
            start-placeholder="開(kāi)始日期"
            end-placeholder="結(jié)束日期">
          </el-date-picker>
        </el-form-item>
 handleUpdate(row) {
      this.reset();
      const id = row.id || this.ids
      var array=[]
      getfuelRates(id).then(response => {
        this.form = response.data;        
        array.push(response.data.startTime,response.data.endTime)
        this.form.time1=array
        this.open = true;
        this.title = "修改";
      });
    },

這樣寫,就會(huì)出現(xiàn)問(wèn)題,數(shù)據(jù)回顯成功之后,無(wú)法改變,如下圖

解決方法:

  handleUpdate(row) {
      this.reset();
      const id = row.id || this.ids
      var array=[]
      getfuelRates(id).then(response => {
        this.form = response.data;        
        array.push(response.data.startTime,response.data.endTime)
        this.$set(this.form,'time1',array);
        this.form.time1=array
        this.open = true;
        this.title = "修改";
      });
    },

 或者

  handleUpdate(row) {
      this.reset();
      const id = row.id || this.ids
      getfuelRates(id).then(response => {
        this.form = response.data;
        this.$set(this.form,'time1',[response.data.startTime,response.data.endTime]);
        this.form.time1=array
        this.open = true;
        this.title = "修改燃油附加費(fèi)";
      });
    },

 重點(diǎn)代碼:

this.$set(this.form,'time1',XXX);

以上就能實(shí)現(xiàn),如下圖

到此這篇關(guān)于vue el-date-picker 日期回顯后無(wú)法改變的文章就介紹到這了,更多相關(guān)vue el-date-picker 日期回顯內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!

相關(guān)文章

最新評(píng)論