有没有一种方法可以避免这种情况,从而使jQuery作为初始加载/渲染的一部分而插入,并且看起来是无缝的?解决方案我最终基于此版本而不是尝试修改默认生成的行为I am using the Swashbuckle package for WebAPI and am attempting to customize the look and feel of the swagger ui default page.I would like to customize the default swagger logo/header. I have added the following to SwaggerConfig.EnableSwaggerUi(c => { c.InjectJavaScript(thisAssembly, typeof(SwaggerConfig).Namespace + ".SwaggerExtensions.custom-js.js"); }The contents of custom-js.js are as follows:$("#logo").replaceWith("<span id=\"test\">test</span>");This works for the most part but the visual is a bit jarring, in that the default swagger header is visible while the page loads and after a brief delay the jquery below kicks and the content of the #logo element is updatedIs there a way to avoid this so that the jquery kicks in as part of the initial load/render and it appears seamless? 解决方案 I ended up adding a new "index.html" based off this versioninstead of trying to modify the behavior of the default generated one 这篇关于如何在Swashbuckle中替换Swagger UI标头徽标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
07-31 12:01