我创建了一个 Grails
项目。现在我想使用 twitter-bootstrap 。我已成功安装bootstrap
。但我想知道如何引用index.html页面
<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>
最佳答案
如果您安装了bootstrap
插件,您只需要调用所需的模块
BuidConfig.groovy
compile ":twitter-bootstrap:2.3.2"
然后在您的GSP
<r:require modules='bootstrap-css, bootstrap-js, bootstrap-modal, ...'/>
关于javascript - 在 Grails 中引用 CSS 文件和 JS 文件 - twitter-bootstrap,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23614564/