关于传值
发布于 5 年前 作者 chao19 5632 次浏览 来自 问答

小弟刚接触小程序不久,目前遇到点问题,如下函数:

fnGetConfig: function (index, projectList, project) {
        if (projectList[index] != "新建项目") {
            wx.cloud.downloadFile({
                fileID: 'cloud:///' + projectList[index] + '.json',
                success: function (res, index) {

                    console.log(index);

               }


在连续多次调用此函数后,本想着根据传入的参数index来判断是哪次调用成功了,但是实际使用时发现在success里,index是undefined,所以无法使用此值,不知还有没有什么办法能够实现?

回到顶部