gouguInit.js 680 B

1234567891011121314151617181920212223242526272829
  1. window.rootPath = (function (src) {
  2. src = document.currentScript
  3. ? document.currentScript.src
  4. : document.scripts[document.scripts.length - 1].src;
  5. return src.substring(0, src.lastIndexOf("/") + 1);
  6. })();
  7. if (typeof $ == "undefined") {
  8. window.jQuery = layui.jquery;
  9. window.$ = layui.jquery;
  10. }
  11. if (typeof moduleInit == "undefined") {
  12. window.moduleInit = [];
  13. }
  14. var module = {};
  15. if (moduleInit.length > 0) {
  16. for (var i = 0; i < moduleInit.length; i++) {
  17. module[moduleInit[i]] = moduleInit[i];
  18. }
  19. }
  20. layui.config({
  21. base: rootPath + "module/",
  22. version: "1.0.0"
  23. }).extend(module).use(moduleInit, function () {
  24. if (typeof gouguInit === 'function') {
  25. gouguInit();
  26. }
  27. });