Liferay 6.0.6插件SDK生成的框架portlet项目中应该如何使用main.js和main.css?
我不愿意将特定于 portlet 的 JS 或 CSS 放入其中,除非
也能在其中工作。只是希望我选择使用的函数/变量名称或类名称足够唯一,这是一个好习惯吗?
I'm reluctant to put portlet-specific JS or CSS in them unless <portlet:namespace />
works in them as well. Is it good practice to just hope that the function/variable names or class names I choose to use are unique enough?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我建议您在 CSS 文件中使用 Portlet ID 作为前缀,例如:
它看起来不太漂亮,但它应该是唯一的,因为您将得到,因为不应该有任何其他具有相同的 Portlet同一 WAR 文件中的名称。
也许其他人有更好的主意?
I would suggest that you use the Portlet ID in your CSS files as prefix so something like:
It won't look pretty, but it should be Unique as you're going to get as there shouldn't be any other portlets with the same name in the same WAR file.
Maybe someone else has a better idea?!