Inject kendo ui with requirejs

前端 未结 1 1505
别跟我提以往
别跟我提以往 2021-01-07 01:42

The documentation on kendo ui and requirejs seems to miss some stuff.

They tell me how to use kendo.web.min which have everything included:

http://www.kendou

相关标签:
1条回答
  • 2021-01-07 01:56

    This is taken from the official Kendo docs at http://docs.kendoui.com/getting-started/using-kendo-with/using-kendo-with-requirejs

    <!-- first, load RequireJS -->
    <script src="require.js"></script>
    
    <!-- configure RequireJS with two logical paths:
         - "app/" will be used for your files
         - "k/" will be for Kendo UI modules -->
    
    <script>
      requirejs.config({
          paths: {
              app: "/path/to/your/files",
              k: "http://cdn.kendostatic.com/VERSION/js"
          }
      });
    
      require([
          "http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js",
          "app/foo",
          "app/bar",
          "k/kendo.menu.min",
          "k/kendo.grid.min"
      ], initApp);
    
      function initApp() {
         // main entry point of your application
      }
    </script>
    

    Assuming that kendo has set up dependencies of their modules correctly, setting up a path like k: "http://cdn.kendostatic.com/VERSION/js which points to the modules directory (NOT one individual module) and use a module in like k/kendo.grid.min should all that's required.

    0 讨论(0)
提交回复
热议问题