我定义了这里定义的jquery no conflict approach Using private jquery with RequireJS - issue after optimisation
但之后我用其他配置加载我的页面。
config.paths.jqueryLayout = ["scripts/jquery.layout-1.3.0"];
config.shim.jqueryLayout = {deps: ['jquery']};
config.paths.jqueryUi = ["scripts/jquery-ui-1.10.min"];
config.shim.jqueryUi = {deps: ['jquery']};
现在将无冲突添加到true ..我正在获得如下所有这些错误,不知道为什么?请有人帮忙吗?
Uncaught TypeError: Cannot read property 'ui' of undefined jquery-ui-1.10.min.js:5
Uncaught TypeError: Cannot read property 'fn' of undefined
Uncaught TypeError: Cannot read property 'fn' of undefined jquery.event.drag-2.0.min.js:6
Uncaught TypeError: undefined is not a function bootstrap.min.js:6
Uncaught TypeError: Cannot call method 'extend' of undefined slick.pager.js:146
Uncaught TypeError: Cannot call method 'extend' of undefined slick.core.js:9
Uncaught TypeError: undefined is not a function highcharts.js:30
Uncaught TypeError: Cannot call method 'extend' of undefined slick.cellselectionmodel.js:3
Uncaught TypeError: Cannot read property 'CellSelectionModel' of undefined
由于
答案 0 :(得分:0)
与该问题相关联的方法:Mapping Modules to use noConflict,说明了这一点:
如果所有模块(包括依赖于jQuery的任何第三方jQuery插件或库代码)与AMD兼容,并且您希望避免......
但您似乎使用了几个不兼容AMD的jQuery插件(即您需要shim
配置),所以我认为您无法使用noConflict方法。