兼容CommonJS

来源:互联网 发布:国产网络腐剧 编辑:程序博客网 时间:2024/06/06 21:39
(function(global, factory) {    //CommonJS/Node    typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :    //AMD    typeof define === 'function' && define.amd ? define(factory) :    //No module loader    (global.VueEvent = factory());}(this, (function() {     function VueEvent(Vue){//code.....    }    // if the script is being run in a web-browser     if (typeof window !== 'undefined' && window.Vue) {        window.Vue.use(VueEvent);    }    return VueEvent;})));

原创粉丝点击