异步加载代码如下:index.js :require.ensure(['../mall/order'],function(require){ var order = require('../mall/order');
});
或者require.ensure([],function(require){ var order = require('../mall/order');
});order.js也没什么特殊的, 里面也同步引用了一些js var CryptoJS = require('crypto-js/core'); require('crypto-js/aes'); require('crypto-js/mode-ecb'); require('crypto-js/pad-pkcs7'); require('crypto-js/enc-utf8'); require('crypto-js/enc-base64'); var CollectionInfo = require('./collectInfo'); require('./user'); require('./address'); var Order = { ...
}
module.exports = Order;order.js打包后被拆成了2个js, 找不到原因import也试过了, 也是把order.js拆成了2个js:import('../mall/order').then(function(order){ var order = order;
});
添加回答
举报
0/150
提交
取消