magento2 RequireJS artDialog

有2种方式

1,修改artdialog的源代码。把里面的jQuery改成jquery

1
2
3
4
5
6
7
8
9
10
11
12
13
14
var config = {
paths: {
'test/owlcarousel': 'Zou_Test/js/owl.carousel',
'artDialog': 'Zou_Test/js/dialog-min'
},
shim: {
'test/owlcarousel': {
deps: ['jquery']
},
"artDialog": {
deps: ["jquery"]
}
}
};

 

2,加载自定义的jquery,命名为jQuery.

因为m2默认的jquery名字为jquery

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
var config = {
paths: {
'test/owlcarousel': 'Zou_Test/js/owl.carousel',
'jQuery': 'Zou_Test/js/jquery-1.10.2',
'artDialog': 'Zou_Test/js/dialog-min'
},
shim: {
'test/owlcarousel': {
deps: ['jquery']
},
"artDialog": {
deps: ["jQuery"]
}
}
};

 

坚持原创技术分享,您的支持将鼓励我继续创作!