[筆記] ofetch api 獲得 statusText 和 status

章節連結

ofetch 若要像 axios 般,於回傳值可以取得 statusText 和 status 的話,會需要透過 raw 的方法先解構出來,然後再自行包裝成一個 Promise 物件吐回。

nuxt-js-logo


內容

程式碼

 

按讚加入粉絲團