在运行时更改选择器的 CSS 属性

发布于 2024-08-08 16:13:03 字数 180 浏览 2 评论 0原文

我有一个为自定义组件定义皮肤类的CSS,如下所示:

view|PlaceHolderView {
    skin-class:ClassReference('view.skin.PlaceHolderSkin');
}

有没有办法在运行时更改该值,以便组件的所有实例切换皮肤?

I have a css that defines de skin-class for a custom component, like this :

view|PlaceHolderView {
    skin-class:ClassReference('view.skin.PlaceHolderSkin');
}

Is there a way to change that value at runtime, so that all instances of the component switch skin?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

寒尘 2024-08-15 16:13:03

经过进一步挖掘后,我找到了问题的答案。

var dec:CSSStyleDeclaration = styleManager.getStyleDeclaration('view.PlaceHolderView')
dec.setStyle('skinClass', MyOtherSkinClass);
styleManager.setStyleDeclaration('view.PlaceHolderView', dec, true);

I found the answer to my question after a bit more digging around.

var dec:CSSStyleDeclaration = styleManager.getStyleDeclaration('view.PlaceHolderView')
dec.setStyle('skinClass', MyOtherSkinClass);
styleManager.setStyleDeclaration('view.PlaceHolderView', dec, true);
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文