我想addClass在我的应用程序中使用 jQuery UI 的功能。
除此之外,我使用的是普通的 jQuery、下划线、主干,所有这些都与 requirejs 一起分层。
我已经像这样配置了 jQuery UI:
require.config({
    deps: ["main"],
    paths: {
        "text": "lib/text"
        , "jquery": "lib/jquery"
        , "jquery-ui": "lib/jquery-ui"
        , "underscore": "lib/underscore"
        , "backbone": "lib/backbone"
        , "bootstrap": "lib/bootstrap"
        , "templates": "../templates"
    },
    shim: {
        "jquery-ui": {
            exports: "$",
            deps: ['jquery']
        },
        "underscore": {
            exports: "_"
        },
        "backbone": {
            exports: "Backbone",
            deps: ["underscore", "jquery"]
        },
        "bootstrap": ['jquery']
    }
});
在我做的应用程序中:
define(['jquery', 'underscore', 'backbone'], function($, _, Backbone) {
    $('div').addClass('white');
});
不幸的是,这只是正常addClass的,而不是来自 jQuery UI 的动画。
PS:我使用完整的 jQuery 版本。