-- select2
-- css
-- select2.css
-- select2.min.css
-- js
-- select2.full.js
-- select2.full.min.js
-- select2.js
-- select2.min.js
其中 select2.full.js
和 select2.js
有什么区别?
通常用select2.min.js,除非你还要引用select2的其他的模块,比如鼠标滚轮,分页等.
看 Github 源码中的 Gruntfile.js,有如下配置
includes = [
"jquery.select2",
"almond",
"jquery-mousewheel" // shimmed for non-full builds
];
fullIncludes = [
"jquery",
"select2/compat/containerCss",
"select2/compat/dropdownCss",
"select2/compat/initSelection",
"select2/compat/inputData",
"select2/compat/matcher",
"select2/compat/query",
"select2/dropdown/attachContainer",
"select2/dropdown/stopPropagation",
"select2/selection/stopPropagation"
].concat(includes);
一般都是用 select2.js
, https://select2.github.io/ 官方首页最下面回答了你的问题。
Standard (select2.js / select2.min.js)
This is the build that most people should be using for Select2. It includes the most commonly used features.
Full (select2.full.js / select2.full.min.js)
You should only use this build if you need the additional features from Select2, like the compatibility modules or recommended includes like jquery.mousewheel