Liferay 6.0.6插件SDK生成的框架portlet项目中应该如何使用main.js和main.css?

发布于 2024-12-19 22:34:14 字数 139 浏览 2 评论 0原文

我不愿意将特定于 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

So要识趣 2024-12-26 22:34:14

我建议您在 CSS 文件中使用 Portlet ID 作为前缀,例如:

#webform_WAR_webformportlet_somedivid { color: black; }

它看起来不太漂亮,但它应该是唯一的,因为您将得到,因为不应该有任何其他具有相同的 Portlet同一 WAR 文件中的名称。

也许其他人有更好的主意?

I would suggest that you use the Portlet ID in your CSS files as prefix so something like:

#webform_WAR_webformportlet_somedivid { color: black; }

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?!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文