(1) .then(res => {函数体})
若需要返回值,则函数体需要return语句
.then(res => res.data)则不需要返回值
(2)当方法没有错误的情况下出现以下情况

原因可能是douban.js模块并没有module导出(ES6标准)
解决方法


(3)模板调用问题

本文深入探讨Promise链中正确处理返回值的方法,解析.then(res=>res.data)与.then(res=>{函数体}
(1) .then(res => {函数体})
若需要返回值,则函数体需要return语句
.then(res => res.data)则不需要返回值
(2)当方法没有错误的情况下出现以下情况

原因可能是douban.js模块并没有module导出(ES6标准)
解决方法


(3)模板调用问题

3万+
3888

被折叠的 条评论
为什么被折叠?