2014-05-12 45 views
0

我创建了一个Grails项目。现在我想用twitter-bootstrap。我已成功安装bootstrap。但我想知道如何引用以下3个环节的index.html page在Grails中引用CSS文件和JS文件 - twitter-bootstrap

<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> 

回答

1

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

BuidConfig.groovy

compile ":twitter-bootstrap:2.3.2" 

然后在你的GSP

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