如何在grails 3.0.4中配置twitter bootstrap?

时间:2015-09-17 19:12:12

标签: twitter-bootstrap grails-3.0

我需要将Grails 2.4.4应用程序迁移到Grails 3.0.9。有人可以解释如何配置twitter bootstrap插件以及如何使用它。

1 个答案:

答案 0 :(得分:0)

After placing the following dependencies in build.gradle: it worked.

build.gradle:

    compile 'org.webjars:bootstrap:3.3.5'
    compile "org.grails:grails-web-boot"
    compile "org.webjars:typeaheadjs:0.11.1"
    compile "org.webjars:bootstrap-tagsinput:0.5"
    compile "org.webjars.bower:bootstrap-table:1.8.1"

application.js:
//= require jquery-2.1.3.js
//= require_tree .
//= require_self
//=require js/jquery-ui-1.10.4.custom.min.js
//=require bootstrap
//=require typeahead
///= require /webjars/bootstrap/3.3.5/js/bootstrap.min
//= require /webjars/bootstrap-tagsinput/0.5/bootstrap-tagsinput
//= require /webjars/typeaheadjs/0.11.1/typeahead.bundle.js

application.css:

*= require main
*= require mobile
*= require_self
*= require webjars/bootstrap/3.3.5/css/bootstrap-theme
*= require webjars/bootstrap/3.3.5/css/bootstrap
*= require webjars/bootstrap-tagsinput/0.5/bootstrap-tagsinput

in the gsp:

    <g:layoutTitle default="main"/></title>
    <meta http-equiv="X-UA-Compatible" content="IE=Edge"/>
    <asset:stylesheet src="application.css"/>
    <asset:javascript src="application.js"/>
    <asset:javascript src="boo.js"/>
    <asset:javascript src="jquery-ui.js"/>
    <g:layoutHead/>