Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要导入一个托管在另一台服务器上且不属于我的应用程序资产的 JS 文件。
如何从组件中导入它?
我最终设置了环境并从内部JavaScriptSupport调用:importJavaScriptLibrarysetupRender()
JavaScriptSupport
importJavaScriptLibrary
setupRender()
@Environmental private JavaScriptSupport javaScriptSupport; public void setupRender() { this.javaScriptSupport.importJavaScriptLibrary("URL-to-JS-file"); }