We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
示例:
function getXXX (callback) { require.async('xxx', callback) } // 预加载 // 这样的使用方式,会导致传递给 require.async 的callback 会是 jq的event对象 // 因为modJS内部的判断 onload && onload.apply... 不够严谨进而导致报错 $(window).on('load', getXXX) // 主动加载 $('#showXXX').on('click', function(e){ getXXX(function(xxx){ xxx.show() }) })
我不得已给getXXX加上了参数校验:
function getXXX (callback) { if (typeof callback !== 'function') callback = function () {}; require.async('xxx', callback) }
The text was updated successfully, but these errors were encountered:
可以提个 PR
Sorry, something went wrong.
No branches or pull requests
示例:
我不得已给getXXX加上了参数校验:
The text was updated successfully, but these errors were encountered: