Shim Twitter Bootstrap for RequireJS

后端 未结 4 2079
轻奢々
轻奢々 2020-12-04 10:32

The RequireJS docs say that to support older versions of IE, you need to configure enforceDefine: true.

So if you want to support Interne

4条回答
  •  孤城傲影
    2020-12-04 11:31

    @lexeme & @benjaminbenben how about wrapping this concept in a RequireJS plugin which creates the shim, requires jQuery and also returns jQuery so you wouldn't need to include this manually?

    To use a bootstrap component you would simply use:

    define(['bootstrap!tooltip'], function($){
      $('[data-toggle="tooltip"]').tooltip();
    });
    

    And you would use this require-bootstrap-plugin to make it work.

提交回复
热议问题