Swagger UI无法正常显示(Swagger UI doesn't display properly)
使用JHipster(和swagger-ui 2.1.5)我想访问“API”选项卡。
然而,它似乎没有正确显示,我在控制台中得到以下错误:
index.html:8 GET http://localhost:8080/swagger-ui/css/typography.css index.html:10 GET http://localhost:8080/swagger-ui/css/screen.css index.html:15 GET http://localhost:8080/swagger-ui/lib/jquery.slideto.min.js index.html:14 GET http://localhost:8080/swagger-ui/lib/jquery-1.8.0.min.js index.html:16 GET http://localhost:8080/swagger-ui/lib/jquery.wiggle.min.js index.html:18 GET http://localhost:8080/swagger-ui/lib/handlebars-2.0.0.js index.html:17 GET http://localhost:8080/swagger-ui/lib/jquery.ba-bbq.min.js index.html:19 GET http://localhost:8080/swagger-ui/lib/lodash.min.js index.html:21 GET http://localhost:8080/swagger-ui/lib/swagger-ui.min.js index.html:13 GET http://localhost:8080/swagger-ui/lib/object-assign-pollyfill.js index.html:22 GET http://localhost:8080/swagger-ui/lib/highlight.9.1.0.pack.js index.html:20 GET http://localhost:8080/swagger-ui/lib/backbone-min.js index.html:24 GET http://localhost:8080/swagger-ui/lib/jsoneditor.min.js index.html:25 GET http://localhost:8080/swagger-ui/lib/marked.js index.html:23 GET http://localhost:8080/swagger-ui/lib/highlight.9.1.0.pack_extended.js index.html:26 GET http://localhost:8080/swagger-ui/lib/swagger-oauth.js index.html:9 GET http://localhost:8080/swagger-ui/css/reset.css index.html:12 GET http://localhost:8080/swagger-ui/css/print.css index.html:14 GET http://localhost:8080/swagger-ui/lib/jquery-1.8.0.min.js index.html:15 GET http://localhost:8080/swagger-ui/lib/jquery.slideto.min.js index.html:16 GET http://localhost:8080/swagger-ui/lib/jquery.wiggle.min.js index.html:17 GET http://localhost:8080/swagger-ui/lib/jquery.ba-bbq.min.js index.html:18 GET http://localhost:8080/swagger-ui/lib/handlebars-2.0.0.js index.html:19 GET http://localhost:8080/swagger-ui/lib/lodash.min.js index.html:20 GET http://localhost:8080/swagger-ui/lib/backbone-min.js index.html:21 GET http://localhost:8080/swagger-ui/lib/swagger-ui.min.js index.html:22 GET http://localhost:8080/swagger-ui/lib/highlight.9.1.0.pack.js index.html:23 GET http://localhost:8080/swagger-ui/lib/highlight.9.1.0.pack_extended.js index.html:24 GET http://localhost:8080/swagger-ui/lib/jsoneditor.min.js index.html:25 GET http://localhost:8080/swagger-ui/lib/marked.js index.html:26 GET http://localhost:8080/swagger-ui/lib/swagger-oauth.js index.html:34 Uncaught ReferenceError: $ is not defined at index.html:34
我使用的是Eclipse(STS发行版),我担心它可能是一个项目配置问题,但由于我相当新,所以我一直无法找出问题的根源。
编辑:
我正在使用Maven,并且错误仍然发生,我通过STS或命令行启动应用程序。
该项目与我想要测试的一项服务不同。
此外,我刚生成一个新的JHipster应用程序,错误依然存在。
编辑':
在我可以访问服务的Edge上,显示效果确实更好。
我还注意到,未改变的应用在Edge上显示效果良好。
Using JHipster (and swagger-ui 2.1.5) I wanted to access the "API" tab.
However it doesn't seem to properly display and I get the following errors in the console :
index.html:8 GET http://localhost:8080/swagger-ui/css/typography.css index.html:10 GET http://localhost:8080/swagger-ui/css/screen.css index.html:15 GET http://localhost:8080/swagger-ui/lib/jquery.slideto.min.js index.html:14 GET http://localhost:8080/swagger-ui/lib/jquery-1.8.0.min.js index.html:16 GET http://localhost:8080/swagger-ui/lib/jquery.wiggle.min.js index.html:18 GET http://localhost:8080/swagger-ui/lib/handlebars-2.0.0.js index.html:17 GET http://localhost:8080/swagger-ui/lib/jquery.ba-bbq.min.js index.html:19 GET http://localhost:8080/swagger-ui/lib/lodash.min.js index.html:21 GET http://localhost:8080/swagger-ui/lib/swagger-ui.min.js index.html:13 GET http://localhost:8080/swagger-ui/lib/object-assign-pollyfill.js index.html:22 GET http://localhost:8080/swagger-ui/lib/highlight.9.1.0.pack.js index.html:20 GET http://localhost:8080/swagger-ui/lib/backbone-min.js index.html:24 GET http://localhost:8080/swagger-ui/lib/jsoneditor.min.js index.html:25 GET http://localhost:8080/swagger-ui/lib/marked.js index.html:23 GET http://localhost:8080/swagger-ui/lib/highlight.9.1.0.pack_extended.js index.html:26 GET http://localhost:8080/swagger-ui/lib/swagger-oauth.js index.html:9 GET http://localhost:8080/swagger-ui/css/reset.css index.html:12 GET http://localhost:8080/swagger-ui/css/print.css index.html:14 GET http://localhost:8080/swagger-ui/lib/jquery-1.8.0.min.js index.html:15 GET http://localhost:8080/swagger-ui/lib/jquery.slideto.min.js index.html:16 GET http://localhost:8080/swagger-ui/lib/jquery.wiggle.min.js index.html:17 GET http://localhost:8080/swagger-ui/lib/jquery.ba-bbq.min.js index.html:18 GET http://localhost:8080/swagger-ui/lib/handlebars-2.0.0.js index.html:19 GET http://localhost:8080/swagger-ui/lib/lodash.min.js index.html:20 GET http://localhost:8080/swagger-ui/lib/backbone-min.js index.html:21 GET http://localhost:8080/swagger-ui/lib/swagger-ui.min.js index.html:22 GET http://localhost:8080/swagger-ui/lib/highlight.9.1.0.pack.js index.html:23 GET http://localhost:8080/swagger-ui/lib/highlight.9.1.0.pack_extended.js index.html:24 GET http://localhost:8080/swagger-ui/lib/jsoneditor.min.js index.html:25 GET http://localhost:8080/swagger-ui/lib/marked.js index.html:26 GET http://localhost:8080/swagger-ui/lib/swagger-oauth.js index.html:34 Uncaught ReferenceError: $ is not defined at index.html:34
I am using Eclipse (STS distribution) and I fear it might be a project configuration problem but as I am fairly new to it I haven't been able to pinpoint the source of the issue.
EDIT:
I am using Maven and the error still occurs wether I launch the app via STS or command line.
The project is as generated except one service that I wanted to test out.
Furthermore I just generated a new JHipster app and the errors remain.
EDIT':
The display is indeed better on Edge where I have access to the services.
I also noted that the unchanged app displays well on Edge.
原文:https://stackoverflow.com/questions/41426124
最满意答案
只需添加
margin-right: -50px;
去.element
更多解释:您要么为.element赋予一个负边限,要么为.element2赋予一个负边限
just add
margin-right: -50px;
to .element
more explanation : you an either give a negative margin-right to .element or give a negative margin-left to .element2
相关问答
更多-
只需添加 margin-right: -50px; 去.element 更多解释:您要么为.element赋予一个负边限,要么为.element2赋予一个负边限 just add margin-right: -50px; to .element more explanation : you an either give a negative margin-right to .element or give a negative margin-left to .element2
-
默认情况下,图像将其底边与文本的基线对齐。 你看到的那个空间是基线以下的空间,被q,p,y等下行器使用(事实上你没有文字是无关紧要的 - 它们的空间仍然是保留的。) 你可以像这样摆脱它: img { /* Or a suitable class, etc. */ vertical-align: bottom; } By default, images align their bottom edges with the baseline of the text. That space you're ...
-
如何使按钮包装图像并通过引导减少它们之间的间距?(How to make buttons wrap images and reduce spacing between them with bootstrap?)[2022-04-25]
将button放在柔性容器中并给出.btn类margin:2px (以2px为例)& padding:0; (然后根据需要用button.btn margin调整它们之间的空间) /* added flex container */ .container { border: 1px solid lightgray; display: flex; flex-flow: row wrap; justify-content: center; /* comment fixed wid ... -
以Peter的答案作为开始,下面的问题解决了这个问题: img { vertical-align: bottom } 这个原理的工作原理是vertical-align的默认值是baseline ,这相当于“悬于线上”的文本部分,其中悬挂比特的位置(小写字母g,q等全部低于此基线)。 所以为了留下空间,这些悬垂物留下了4px的空间。 希望这是有道理的。 编辑:从源网站的视觉援助 替代文字http://www.brightlemon.com/web-design/blog/images/typography/ ...
-
GWT剪辑图像(GWT Clipped image)[2022-02-08]
GWT使用CSS2样式(以及空白图像内容)实现剪切图像,如下例所示: width: 300px; height: 300px; background: url("/team.png") no-repeat scroll -5px -5px transparent; 不幸的是,CSS2不支持缩放背景(url提供的)图像,所以没有一种自然的方式来使用内置的GWT库来缩放剪裁的图像。 一种选择是使用画布,并将图像加载到其中,如下所述: http://code.google.com/p/google-web-t ... -
div之间的间距(Spacing between divs)[2022-05-12]
这可能是ul的余量引起的。 .sb-con ul { padding:0; margin:0; } 可能会产生预期的效果。 li可能也会影响布局; 但我们无法从您提供的代码中判断出来。 您的“全部捕获”重置会删除默认的边距/填充; 因此为什么它看起来不错。 编辑 - 您的.sb-title h3也可能需要删除底部边距,因为它看起来像是使用固定高度(60px)但默认边距会增加额外高度。 这可以通过firebug或Chrome的网络检查器轻松调试,并可以直观地显示间距的来源。 It's likely the ... -
在这里看演示 。 这是您可以使用的功能: function changeBodyBackground() { var images = ['http://goo.gl/tQl3t', 'http://goo.gl/6t3lG', 'http://goo.gl/HDzqs'] var imagesWidth = 260; var screenWidthToCover = ...
-
图像之间的垂直间距(vertical spacing between images)[2023-06-18]
尝试这个。 删除它们之间的线条。 或者修补css。 img { padding: 0; margin: 0; } try this. Remove the lines betw ... -
图像之间的内部间距?(Inner spacing between images?)[2022-04-23]
你需要的是容器元素的负边距: http://jsfiddle.net/LYhum/ .container { margin: -10px 0 0 -10px; } .container .image { margin: 10px 0 0 10px; /* either floated or set to inline-block */ } 如果你的容器有响应(即你不知道它有多宽),那么flexbox值得一看: http://jsfiddle.net/LYhum/4/ (对没有Fl ... -
图像部分被剪裁(Image is partly clipped)[2022-06-07]
用作行背景的图像是: http://myperfume.ir/images/2_02.png 哪个已被剪裁,因此您需要更改它。 The image that is being used as the row's background is this: http://myperfume.ir/images/2_02.png Which is already clipped, so you'll need to change it.