简体   繁体   English

AMD jQuery Multiselect小部件

[英]AMD jQuery Multiselect Widget

I'm trying to use jQuery multi-select widget with AMD and handlebars. 我正在尝试将jQuery 多选小部件与AMD和车把一起使用。 Here's the handlebars snippet: 这是把手片段:

{{#section 'js'}}
  <script type='text/javascript' nonce="{{nonce}}">
    requirejs([
      "domReady",
      "app/ui/js/utils/Chart.min",
      "app/ui/js/utils/jquery.multiselect",
      "app/ui/js/utils/jquery-ui.min",
      "app/ui/js/y",

    ],
    function(wrapper, domReady, x) {
      domReady(function() {
        $.when(wrapper.init()).then(
          function() {
            x.init();
          }
        );
      });
    });
  </script>
{{/section}}

Here are the contents of y.js : 以下是y.js的内容:

define([
        'jquery',
        'app/ui/rest/x',
        'app/ui/js/utils/errorhandlingutils'
], function( $, restX, errorHandler ) {
    "use strict";
    function _init() {
        //Do something
    }
    return {
        init: function() {

            //Global Init function
            _init();
        }
    };
});

I want to use the multi-select widget in y.js . 我想在y.js使用多选小部件。 How should I do that? 我应该怎么做?

我在车把片段中添加了"jquery"作为依赖项来解决此问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM