1

我在代码中使用 Html 类名不可见。

在此处输入图像描述

但如果我使用检查元素,我可以找到它使用的 HTML 类名,例如 slds-carousel__content 等。

在此处输入图像描述

我的问题是我无法在客户端控制器上访问这些类名。有没有办法得到那些类名?

4

1 回答 1

0

Here is a link to that describes how to change the class. You can get the component by using component.find("insertnamehere").getElement(); It's not always reliable unless you are specifying a render attribute on the controller though.

https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/js_cb_show_hide_markup.htm

as a side note: as sanctimonious as some of the mods on the Salesforce stackoverflow might seem, it is still a more likely place to find such content. Good luck.

于 2018-10-31T15:32:09.523 回答