【问题标题】:Referencing CSS files and JS files in Grails - twitter-bootstrap在 Grails 中引用 CSS 文件和 JS 文件 - twitter-bootstrap
【发布时间】:2014-05-12 16:46:39
【问题描述】:

我创建了一个Grails 项目。现在我想使用twitter-bootstrap。我已经成功安装了bootstrap。但我想知道如何引用index.html page中的以下3个链接

<r:require modules="bootstrap" />
<r:layoutResources />
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet"
    href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">

<!-- Optional theme -->
<link rel="stylesheet"
    href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap-theme.min.css">

<!-- Latest compiled and minified JavaScript -->
<script
    src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>

【问题讨论】:

    标签: javascript html twitter-bootstrap grails


    【解决方案1】:

    如果您安装了bootstrap 插件,您只需调用所需的模块

    BuidConfig.groovy

    compile ":twitter-bootstrap:2.3.2"
    

    然后在你的GSP

    <r:require modules='bootstrap-css, bootstrap-js, bootstrap-modal, ...'/>
    

    【讨论】:

      猜你喜欢
      • 2013-03-20
      • 2018-03-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-02-12
      • 2012-12-25
      • 2016-08-09
      相关资源
      最近更新 更多