调用的时候提示callback.call is not a function,新手求解

findFolders (data, callback) {

    let postData = ''

    if (data.hasOwnProperty('id')) {

      postData ? postData = postData + '&id=' + data.id : postData = postData + 'id=' + data.id

    }

    if (data.hasOwnProperty('cache')) {

      postData ? postData = postData + '&cache=' + data.cache : postData = postData + 'cache=' + data.cache

    }

    if (data.hasOwnProperty('global')) {

      postData ? postData = postData + '&global=' + 'true' : postData = postData + 'cache=' + data.cache

    }

    ajax.get({

      url: '/folder/findFolders?' + postData,

      success (d) {

        callback && callback.call(this, d)

      }

    })

  }


人到中年有点甜
浏览 6810回答 2
2回答

红颜莎娜

请确定你传入的callback是function类型
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

JavaScript