grails 3.3.2中的Bootstrap错误

时间:2018-01-14 15:32:38

标签: twitter-bootstrap grails grails-3.3

以前我使用的是带有Grails 2.5.1的Bootstrap,它运行正常,现在我正在使用它Grails 3.3.2我在Chrome inspect访问{{1}时遇到以下错误}}:

index.gsp

Uncaught Error: Bootstrap's JavaScript requires jQuery BootStrap

中的assets\javascripts\bootStrap\bootstrap.min.js个文件

这里是assets\stylesheets\bootStrap\bootstrap.min.css

index.gsp

此页面上的所有图片也没有显示,我将其添加到 <!doctype html> <html> <head> <meta name="layout" content="mainBS"/> <title>Welcome to Grails</title> </head> <body> <content tag="nav"> <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Application Status <span class="caret"></span></a> <ul class="dropdown-menu"> <li><a href="#">Environment: ${grails.util.Environment.current.name}</a></li> <li><a href="#">App profile: ${grailsApplication.config.grails?.profile}</a></li> <li><a href="#">App version: <g:meta name="info.app.version"/></a> </li> <li role="separator" class="divider"></li> <li><a href="#">Grails version: <g:meta name="info.app.grailsVersion"/></a> </li> <li><a href="#">Groovy version: ${GroovySystem.getVersion()}</a></li> <li><a href="#">JVM version: ${System.getProperty('java.version')}</a></li> <li role="separator" class="divider"></li> <li><a href="#">Reloading active: ${grails.util.Environment.reloadingAgentEnabled}</a></li> </ul> </li> <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Artefacts <span class="caret"></span></a> <ul class="dropdown-menu"> <li><a href="#">Controllers: ${grailsApplication.controllerClasses.size()}</a></li> <li><a href="#">Domains: ${grailsApplication.domainClasses.size()}</a></li> <li><a href="#">Services: ${grailsApplication.serviceClasses.size()}</a></li> <li><a href="#">Tag Libraries: ${grailsApplication.tagLibClasses.size()}</a></li> </ul> </li> </content> <div class="svg" role="presentation"> <div class="grails-logo-container"> <asset:image src="grails-cupsonly-logo-white.svg" class="grails-logo"/> </div> </div> <div id="content" role="main"> <section class="row colset-2-its"> <h1>Welcome to Grails</h1> <p> Congratulations, you have successfully started your first Grails application! At the moment this is the default page, feel free to modify it to either redirect to a controller or display whatever content you may choose. Below is a list of controllers that are currently deployed in this application, click on each to execute its default action: </p> <div id="controllers" role="navigation"> <h2>Available Controllers:</h2> <ul> <g:each var="c" in="${grailsApplication.controllerClasses.sort { it.fullName } }"> <li class="controller"> <g:link controller="${c.logicalPropertyName}">${c.fullName}</g:link> </li> </g:each> </ul> </div> </section> </div> </body> </html> ,但无效:

build.gradle

我在这里缺少什么?

2 个答案:

答案 0 :(得分:1)

确保js包含的层次结构如下

enter image description here

答案 1 :(得分:0)

你缺少必须在任何其他脚本之前包含的jQuery js,比如bootstrap.js