在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 問答/HTML/ Promise then then沒有產(chǎn)生依賴關(guān)系效果?

Promise then then沒有產(chǎn)生依賴關(guān)系效果?

像下面這樣寫兩個互相依賴的ajax操作,refreshStatus函數(shù)內(nèi)部沒有拿到getDesktopList的返回結(jié)果:

  var promise = Promise.resolve()
  promise
    .then(this.getDesktopList())
    .then(this.refreshStatus())
    .catch(function() {})
回答
編輯回答
風畔

then 處理后要將 promise return 出來才能下一步繼續(xù) then

2018年3月23日 12:41
編輯回答
拼未來

this.getDesktopList()也要返回promise對象哦。

2018年7月26日 08:51
編輯回答
護她命

this.getDesktopList()這個方法也要return 噢 不然不是promise對象不能繼續(xù)then下去

2017年7月18日 16:45