使用 JHipster 设置后,菜单不会在浏览器中下拉

Menus not dropping down in browser after setup with JHipster

我一直在使用JHipster Mini Book to learn AngularJS and Spring Boot but I've hit a snag near the beginning of the book, at page 14. So far, I have run "yo jhipster", created a PostgreSQL database, and installed material design with "bower install bootstrap-material-design --save" and "grunt wiredep", with the configuration edits described in the book. When I run "gradlew bootRun", everything starts up and I can browse to "http://127.0.0.1:8080”,得到了书中图2所示的预期页面。

问题是即使我登录后,下拉菜单也没有下拉。

我正在使用 Windows 8.1 和 node.js 5.2.0、npm 3.5.1、bower 1.7.0 和 jhipster 2.26.1。还有 PostgreSQL 9.4.5。我还必须安装 Visual Studio Express 2015(带有更新 1)和所有相关文件,以便 node.js 可以工作。更不用说Python 2.7.1。我已经解决了 https://github.com/nodejs/node-gyp/issues/629#issuecomment-153196245 and Unable to Connect to GitHub.com For Cloning

中提到的问题

我用GoogleChrome(版本47.0.2526.106m)和Internet Explorer(11.0.9600.18098)进行了测试。我已经检查过两个浏览器都允许 JavaScript,并且其他 JS 密集型网站也能正常工作。

我多次重新创建项目,所以我认为我没有遗漏任何步骤。

因为我是新手 AngularJS 我不知道这是 JHipster 的问题还是我的环境有问题。

我还能在哪里查找问题?

更新 22/12/2015

在上面提到的 JHipster 书的第 13 页上,第 13 页有一个说明 运行

bower install bootstrap-material-design --save

接着是

grunt wiredep

这会向 src\main\webapp\index.html 添加一些行(在其他文件中)

<script src="bower_components/bootstrap-sass/assets/javascripts/bootstrap.js"></script>
<script src="bower_components/bootstrap-material-design/dist/js/material.js"></script>
<script src="bower_components/bootstrap-material-design/dist/js/ripples.js"></script>

第一个是问题 - 当我删除它时,一切似乎都正常(除了我没有测试所有东西所以以后可能会发现问题)。我不知道那个 .js 文件有什么问题。

因为你使用了bootstrap-material设计库,bootstrap导航栏的下拉菜单有一些改进。如果你想修复它,2 个解决方案:

  • 不要使用 bootstrap-material-设计(如您所说)
  • 如果您想使用 bootstrap-material-设计,您需要在 navbar.html 文件中修复一些 html。更多信息:

你运行在你的index.html吗?

<script type="text/javascript">
     $.material.init() 
</script>