美文网首页
多种js环境加载使用的写法

多种js环境加载使用的写法

作者: sorry510 | 来源:发表于2019-12-08 18:36 被阅读0次
(function (root, factory) {
    if (typeof exports === 'object') {
        module.exports = factory()
    } else if (typeof define === 'function' && define.amd) {
        define(factory)
    } else {
        root.xxx = factory()
    }
})(this, function () {
    return function(a) {
       
    }
})

相关文章

网友评论

      本文标题:多种js环境加载使用的写法

      本文链接:https://www.haomeiwen.com/subject/uvlfbctx.html