我需要在我的代码中使用这个滑块插件 "slick",但是我无法做到!
在配置文件中,我有以下内容;
define('modules/slider', ['jquery', 'slick'], function($, slick) {
var widgetDisplay = function() {};
widgetDisplay.prototype = {
name: 'Display',
init: function(scope) {
"use strict";
var me = this;
console.log('slider module loaded + ' + slick);
}
};
return widgetDisplay;
});
在配置文件中,我有以下内容;
require.config({
baseUrl: '<?php echo WPF__ASSETS; ?>scripts/',
paths: {
"modernizr": "<?php echo WPF__ASSETS; ?>scripts/modernizr",
"jquery": "<?php echo WPF__ASSETS; ?>scripts/jquery",
"fastclick": "<?php echo WPF__ASSETS; ?>scripts/fastclick",
"foundation": "<?php echo WPF__ASSETS; ?>scripts/foundation",
"slick": "<?php echo WPF__ASSETS; ?>scripts/slick"
},
shim: {
'foundation': {
deps: ['jquery']
},
'slick': {
deps: ['jquery'],
exports: 'jQuery.fn.slick'
},
'modernizr': {
exports: 'modernizr'
}
}
});
但是他的输出报错;
未捕获的引用错误:slick未定义